Switch unsetenv to __delitem__ in test case cleanup

`unsetenv` isn't supported on all platforms
pull/255/head
Will Badart 5 years ago
parent 2e0eefe91e
commit 257cd5f991
No known key found for this signature in database
GPG Key ID: C0BFCABCFFB2398B

@ -288,7 +288,7 @@ class CommandLineTestCase(unittest.TestCase):
def test_run_with_user_yamllintrc_config_file(self): def test_run_with_user_yamllintrc_config_file(self):
config = os.path.join(self.wd, 'fake-local-config') config = os.path.join(self.wd, 'fake-local-config')
self.addCleanup(os.remove, config) self.addCleanup(os.remove, config)
self.addCleanup(os.environ.unsetenv, 'YAMLLINTRC') self.addCleanup(os.environ.__delitem__, 'YAMLLINTRC')
os.environ['YAMLLINTRC'] = config os.environ['YAMLLINTRC'] = config
with open(config, 'w') as f: with open(config, 'w') as f:

Loading…
Cancel
Save