Skip to content

Commit 4ab844c

Browse files
committed
test: be flexible about how HTML files are named
Coverage.py 6.0 changed the way the HTML files are named. Now it could be either: - old: htmlcov/templates_test_simple_html.html - new: htmlcov/d_9ed9d281467a41a1_test_simple_html.html
1 parent 8fe4534 commit 4ab844c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_html.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
"""Tests of HTML reporting for django_coverage_plugin."""
66

7+
import glob
8+
79
from .plugin_test import DjangoPluginTestCase
810

911

@@ -16,6 +18,7 @@ def test_simple(self):
1618

1719
self.run_django_coverage()
1820
self.cov.html_report()
19-
with open("htmlcov/templates_test_simple_html.html") as fhtml:
21+
html_file = glob.glob("htmlcov/*_test_simple_html.html")[0]
22+
with open(html_file) as fhtml:
2023
html = fhtml.read()
2124
self.assertIn('<span class="txt">Simple &#169; 2015</span>', html)

0 commit comments

Comments
 (0)