Browse Source

modified method to remove keys

Eyitayo Ogunbiyi 4 years ago
parent
commit
326e37eb69
1 changed files with 4 additions and 2 deletions
  1. 4 2
      test_howdoi.py

+ 4 - 2
test_howdoi.py

@@ -54,8 +54,10 @@ class HowdoiTestCase(unittest.TestCase):
         self.assertTrue(len(res) > 0)
 
     def tearDown(self):
-        os.environ['HOWDOI_URL'] = ''
-        os.environ['HOWDOI_SEARCH_ENGINE'] = ''
+        keys_to_remove = ['HOWDOI_URL', 'HOWDO_SEARCH_ENGINE']
+        for key in keys_to_remove:
+            if key in os.environ:
+                del os.environ[key]
 
     def test_get_link_at_pos(self):
         self.assertEqual(howdoi.get_link_at_pos(['/questions/42/'], 1),