From 391bd5d5fec0943bb4dbe2862308c229d4cdf84c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 22 Aug 2018 19:33:25 -0400 Subject: Better handling of the absolute paths to the test temp directory --- tests/test_html.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests/test_html.py') 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", 'here.py', 'other_py.html">', 'other.py', ) -- cgit v1.2.1