summaryrefslogtreecommitdiff
path: root/tests/goldtest.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-24 07:13:42 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-24 07:13:42 -0400
commitc4b2392dd51b7f976972afb00f01d4618c523cff (patch)
tree7c77b420d4eec7ac628393663c67c0e9bc2c66f7 /tests/goldtest.py
parent8a337f91e6444c027771741a56636a56389706e3 (diff)
parentdd5b0cc88ebe4528abaa7cdf0b3fd516fb1f7e01 (diff)
downloadpython-coveragepy-git-c4b2392dd51b7f976972afb00f01d4618c523cff.tar.gz
Merge branch 'nedbat/data-sqlite'
Diffstat (limited to 'tests/goldtest.py')
-rw-r--r--tests/goldtest.py32
1 files changed, 4 insertions, 28 deletions
diff --git a/tests/goldtest.py b/tests/goldtest.py
index 8f24f239..48842f0c 100644
--- a/tests/goldtest.py
+++ b/tests/goldtest.py
@@ -4,39 +4,15 @@
"""A test base class for tests based on gold file comparison."""
import os
-import sys
from unittest_mixins import change_dir # pylint: disable=unused-import
-from tests.coveragetest import CoverageTest
-from tests.test_farm import clean
+from tests.coveragetest import TESTS_DIR
# Import helpers, eventually test_farm.py will go away.
from tests.test_farm import ( # pylint: disable=unused-import
compare, contains, doesnt_contain, contains_any,
)
-
-class CoverageGoldTest(CoverageTest):
- """A test based on gold files."""
-
- run_in_temp_dir = False
-
- def setUp(self):
- super(CoverageGoldTest, self).setUp()
- self.chdir(self.root_dir)
- # Modules should be importable from the current directory.
- sys.path.insert(0, '')
-
- def output_dir(self, the_dir):
- """Declare where the output directory is.
-
- The output directory is deleted at the end of the test, unless the
- COVERAGE_KEEP_OUTPUT environment variable is set.
-
- """
- # To make sure tests are isolated, we always clean the directory at the
- # beginning of the test.
- clean(the_dir)
-
- if not os.environ.get("COVERAGE_KEEP_OUTPUT"): # pragma: part covered
- self.addCleanup(clean, the_dir)
+def gold_path(path):
+ """Get a path to a gold file for comparison."""
+ return os.path.join(TESTS_DIR, "farm", path)