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 | 8b02c8b66c2e417a258ff60c375c57b839d550b5 (patch) | |
tree | 7d9f42e98643bd987295396cc9991822b253bd8f | |
parent | 5eeccec6a6113b9e2537d7d8716a7d580a4952c7 (diff) | |
download | python-coveragepy-git-8b02c8b66c2e417a258ff60c375c57b839d550b5.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 4ad47424..39f2bfda 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) |