From 8b02c8b66c2e417a258ff60c375c57b839d550b5 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 5 Feb 2016 08:40:43 -0500 Subject: Don't let old tests results interfere with new tests --- tests/goldtest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/goldtest.py') 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) -- cgit v1.2.1