diff options
Diffstat (limited to 'test/coveragetest.py')
-rw-r--r-- | test/coveragetest.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/coveragetest.py b/test/coveragetest.py index 1fb04721..073dc39f 100644 --- a/test/coveragetest.py +++ b/test/coveragetest.py @@ -168,12 +168,13 @@ class CoverageTest(TestCase): cov.exclude(exc) cov.start() - # Import the python file, executing it. - mod = self.import_module(modname) - - # Stop Coverage. - cov.stop() - + try: + # Import the python file, executing it. + mod = self.import_module(modname) + finally: + # Stop Coverage. + cov.stop() + # Clean up our side effects del sys.modules[modname] |