Commit 12f1191b authored by Stefan Behnel's avatar Stefan Behnel

minor test code cleanup

parent 40389081
...@@ -95,8 +95,9 @@ def test_zip(): ...@@ -95,8 +95,9 @@ def test_zip():
import test_zip_module import test_zip_module
assert test_zip_module.x == 42 assert test_zip_module.x == 42
finally: finally:
os.remove(zip_path) if zip_path in sys.path:
sys.path.remove(zip_path) sys.path.remove(zip_path)
os.remove(zip_path)
def test_zip_nonexisting(): def test_zip_nonexisting():
...@@ -105,6 +106,8 @@ def test_zip_nonexisting(): ...@@ -105,6 +106,8 @@ def test_zip_nonexisting():
import nonexisting_zip_module import nonexisting_zip_module
except ImportError: except ImportError:
pass pass
finally:
sys.path.remove("nonexisting_zip_module.zip")
if __name__== "__main__": if __name__== "__main__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment