From e1f32078026835c26272b598b8408c4a86329180 Mon Sep 17 00:00:00 2001 From: Ella Wu <602725+nwu63@users.noreply.github.com> Date: Sat, 16 Mar 2024 23:56:20 -0700 Subject: [PATCH] cast to list first --- tests/test_other.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_other.py b/tests/test_other.py index 8a1c9fec..c7f4bd27 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -14,7 +14,7 @@ class TestImportSnoptFromPath(unittest.TestCase): def test_nonexistent_path(self): # first unload `snopt` from namespace - for key in sys.modules.keys(): + for key in list(sys.modules.keys()): if "snopt" in key: sys.modules.pop(key) with self.assertWarns(ImportWarning):