summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-23 19:01:27 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-23 20:01:48 -0400
commitbd929f953734f3f5d6cf3e0534aa573b44fc45e2 (patch)
treef4acb62cc7983c64dfdf3488e8bc9e82d1c350d4 /tests/test_html.py
parentc8ac44828eddfcb444dcdcfc7668370054e96cb9 (diff)
downloadpython-coveragepy-git-bd929f953734f3f5d6cf3e0534aa573b44fc45e2.tar.gz
fix(html): fix a few problems with the html report
- highlights weren't showing - anchored lines were not visible - some j/k motions were broken - clicking the big buttons at the top didn't work
Diffstat (limited to 'tests/test_html.py')
-rw-r--r--tests/test_html.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index 84cc2d4c..849be567 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -23,7 +23,7 @@ from coverage.report import get_analysis_to_report
from tests.coveragetest import CoverageTest, TESTS_DIR
from tests.goldtest import gold_path
-from tests.goldtest import compare, contains, doesnt_contain, contains_any
+from tests.goldtest import compare, contains, contains_rx, doesnt_contain, contains_any
from tests.helpers import assert_coverage_warnings, change_dir
@@ -893,14 +893,14 @@ assert len(math) == 18
if env.PYBEHAVIOR.pep626:
cov.html_report(partial, directory="out/partial_626")
compare_html(gold_path("html/partial_626"), "out/partial_626")
- contains(
+ contains_rx(
"out/partial_626/partial_py.html",
- '<p id="t4" class="par run show_par">',
- '<p id="t7" class="run">',
+ r'<p class="par run show_par">.* id="t4"',
+ r'<p class="run">.* id="t7"',
# The "if 0" and "if 1" statements are marked as run.
- '<p id="t10" class="run">',
+ r'<p class="run">.* id="t10"',
# The "raise ZeroDivisionError" is excluded by regex in the .ini.
- '<p id="t17" class="exc show_exc">',
+ r'<p class="exc show_exc">.* id="t17"',
)
contains(
"out/partial_626/index.html",
@@ -910,14 +910,14 @@ assert len(math) == 18
else:
cov.html_report(partial, directory="out/partial")
compare_html(gold_path("html/partial"), "out/partial")
- contains(
+ contains_rx(
"out/partial/partial_py.html",
- '<p id="t4" class="par run show_par">',
- '<p id="t7" class="run">',
+ r'<p class="par run show_par">.* id="t4"',
+ r'<p class="run">.* id="t7"',
# The "if 0" and "if 1" statements are optimized away.
- '<p id="t10" class="pln">',
+ r'<p class="pln">.* id="t10"',
# The "raise ZeroDivisionError" is excluded by regex in the .ini.
- '<p id="t17" class="exc show_exc">',
+ r'<p class="exc show_exc">.* id="t17"',
)
contains(
"out/partial/index.html",