summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-22 19:33:25 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-24 06:54:17 -0400
commit391bd5d5fec0943bb4dbe2862308c229d4cdf84c (patch)
treed78d5226906634ceebdbbe37ed217de180aec94d /tests/test_html.py
parent870bc0ac4c133876a5a5ab71df1024863bda60c0 (diff)
downloadpython-coveragepy-git-391bd5d5fec0943bb4dbe2862308c229d4cdf84c.tar.gz
Better handling of the absolute paths to the test temp directory
Diffstat (limited to 'tests/test_html.py')
-rw-r--r--tests/test_html.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index d872c1b4..07ddba82 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -579,8 +579,11 @@ def compare_html(dir1, dir2):
(r'/Users/ned/coverage/trunk/tests', 'TESTS_DIR'),
(flat_rootname(unicode_class(TESTS_DIR)), '_TESTS_DIR'),
(flat_rootname(u'/Users/ned/coverage/trunk/tests'), '_TESTS_DIR'),
+ # The temp dir the tests make.
(re.escape(os.getcwd()), 'TEST_TMPDIR'),
(flat_rootname(unicode_class(os.getcwd())), '_TEST_TMPDIR'),
+ (r'/private/var/folders/[\w/]{35}/coverage_test/tests_test_html_\w+_\d{8}', 'TEST_TMPDIR'),
+ (r'_private_var_folders_\w{35}_coverage_test_tests_test_html_\w+_\d{8}', '_TEST_TMPDIR'),
]
if env.WINDOWS:
# For file paths...
@@ -898,15 +901,15 @@ assert len(math) == 18
cov.start()
import here # pragma: nested # pylint: disable=unused-variable, import-error
cov.stop() # pragma: nested
- cov.html_report(directory="../out/other")
+ cov.html_report(directory="../out")
# Different platforms will name the "other" file differently. Rename it
- for p in glob.glob("out/other/*_other_py.html"):
- os.rename(p, "out/other/blah_blah_other_py.html")
+ for p in glob.glob("out/*_other_py.html"):
+ os.rename(p, "out/blah_blah_other_py.html")
- compare_html("out/other", gold_path("html/gold_other"))
+ compare_html("out", gold_path("html/gold_other"))
contains(
- "out/other/index.html",
+ "out/index.html",
'<a href="here_py.html">here.py</a>',
'other_py.html">', 'other.py</a>',
)