From 257cd5f991a95ea4df5d349a772536bb6272046c Mon Sep 17 00:00:00 2001 From: Will Badart Date: Wed, 22 Apr 2020 08:51:30 -0700 Subject: [PATCH] Switch unsetenv to __delitem__ in test case cleanup `unsetenv` isn't supported on all platforms --- tests/test_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index f340417..fa74d83 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -288,7 +288,7 @@ class CommandLineTestCase(unittest.TestCase): def test_run_with_user_yamllintrc_config_file(self): config = os.path.join(self.wd, 'fake-local-config') self.addCleanup(os.remove, config) - self.addCleanup(os.environ.unsetenv, 'YAMLLINTRC') + self.addCleanup(os.environ.__delitem__, 'YAMLLINTRC') os.environ['YAMLLINTRC'] = config with open(config, 'w') as f: