summaryrefslogtreecommitdiff
path: root/tests/test_xml.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-22 10:03:33 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-24 06:54:17 -0400
commit7f5fb57e3e264f134c162dfb25c92e2b2d0e79e0 (patch)
tree6102f4cff83c1d5653ef86742052ab287cd1b69b /tests/test_xml.py
parent6df4275aa5e15e0f9033946837c1168a7dec00d5 (diff)
downloadpython-coveragepy-git-7f5fb57e3e264f134c162dfb25c92e2b2d0e79e0.tar.gz
Stop using farm/src for HTML tests.
Diffstat (limited to 'tests/test_xml.py')
-rw-r--r--tests/test_xml.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/test_xml.py b/tests/test_xml.py
index dd2de007..65c1a48b 100644
--- a/tests/test_xml.py
+++ b/tests/test_xml.py
@@ -12,8 +12,8 @@ import coverage
from coverage.backward import import_local_file
from coverage.files import abs_file
-from tests.coveragetest import CoverageTest, TESTS_DIR
-from tests.goldtest import change_dir, compare
+from tests.coveragetest import CoverageTest
+from tests.goldtest import change_dir, compare, gold_path
from tests.helpers import re_line, re_lines
@@ -309,9 +309,6 @@ def clean(text, scrub=None):
return text
-def farm_dir(path):
- return os.path.join(TESTS_DIR, "farm", path)
-
class XmlGoldTest(CoverageTest):
"""Tests of XML reporting that use gold files."""
@@ -331,7 +328,7 @@ class XmlGoldTest(CoverageTest):
cov.xml_report(a, outfile="coverage.xml")
source_path = coverage.files.relative_directory().rstrip(r"\/")
- compare(".", farm_dir("html/gold_x_xml"), left_extra=True, scrubs=[
+ compare(".", gold_path("html/gold_x_xml"), left_extra=True, scrubs=[
(r' timestamp="\d+"', ' timestamp="TIMESTAMP"'),
(r' version="[-.\w]+"', ' version="VERSION"'),
(r'<source>\s*.*?\s*</source>', '<source>%s</source>' % source_path),
@@ -360,7 +357,7 @@ class XmlGoldTest(CoverageTest):
cov.xml_report(a)
source_path = coverage.files.relative_directory().rstrip(r"\/")
- compare("xml_2", farm_dir("html/gold_x_xml"), scrubs=[
+ compare("xml_2", gold_path("html/gold_x_xml"), scrubs=[
(r' timestamp="\d+"', ' timestamp="TIMESTAMP"'),
(r' version="[-.\w]+"', ' version="VERSION"'),
(r'<source>\s*.*?\s*</source>', '<source>%s</source>' % source_path),
@@ -385,7 +382,7 @@ class XmlGoldTest(CoverageTest):
cov.xml_report(y, outfile="y_xml_branch/coverage.xml")
source_path = coverage.files.relative_directory().rstrip(r"\/")
- compare("y_xml_branch", farm_dir("html/gold_y_xml_branch"), scrubs=[
+ compare("y_xml_branch", gold_path("html/gold_y_xml_branch"), scrubs=[
(r' timestamp="\d+"', ' timestamp="TIMESTAMP"'),
(r' version="[-.\w]+"', ' version="VERSION"'),
(r'<source>\s*.*?\s*</source>', '<source>%s</source>' % source_path),