diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-05 08:40:43 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-05 08:40:43 -0500 |
commit | 7830bb348ae93376b046b821e827cb1b74e6c13a (patch) | |
tree | 70f240be1c4340b8334ac3447870528779950819 | |
parent | ad8321bd6d874ce43666c9cb69a7a664776a07fa (diff) | |
download | python-coveragepy-7830bb348ae93376b046b821e827cb1b74e6c13a.tar.gz |
Don't let old tests results interfere with new tests
-rw-r--r-- | tests/goldtest.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/goldtest.py b/tests/goldtest.py index 4ad4742..39f2bfd 100644 --- a/tests/goldtest.py +++ b/tests/goldtest.py @@ -34,9 +34,9 @@ class CoverageGoldTest(CoverageTest): COVERAGE_KEEP_OUTPUT environment variable is set. """ - self.addCleanup(self.cleanup_output_dir, the_dir) + # To make sure tests are isolated, we always clean the directory at the + # beginning of the test. + clean(the_dir) - def cleanup_output_dir(self, the_dir): - """Clean up the output directory of the test.""" if not os.environ.get("COVERAGE_KEEP_OUTPUT"): # pragma: partial - clean(the_dir) + self.addCleanup(clean, the_dir) |