pytest-dev / pytest-html

Plugin for generating HTML reports for pytest results
Other
697 stars 235 forks source link

3.1.1: pytest is failing #526

Closed kloczek closed 7 months ago

kloczek commented 2 years ago

+++ pytest is failing I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

kloczek commented 2 years ago

Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-html-3.1.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-html-3.1.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1, configfile: tox.ini, testpaths: testing plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 89 items testing/test_pytest_html.py FFFFFFFF.FFFFF............................FFFF.........FF......FFF....F.......FF.FFFFFFFF [100%] ================================================================================= FAILURES ================================================================================= _________________________________________________________________________ TestHTML.test_durations __________________________________________________________________________ self = , testdir = def test_durations(self, testdir): sleep = float(0.2) testdir.makepyfile( """ import time def test_sleep(): time.sleep({:f}) """.format( sleep * 2 ) ) result, html = run(testdir) assert result.ret == 0 > assert_results(html, duration=sleep) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:113: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_durations0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_durations.py . [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_durations0/report.html - ============================== 1 passed in 0.43s =============================== ____________________________________________ TestHTML.test_can_format_duration_column[%f-\\d{2}] _____________________________________________ self = , testdir = duration_formatter = '%f', expected_report_content = '\\d{2}' @pytest.mark.parametrize( "duration_formatter,expected_report_content", [ ("%f", r'\d{2}'), ("%S.%f", r'\d{2}\.\d{2}'), ( "ABC%H %M %S123", r'ABC\d{2} \d{2} \d{2}123', ), ], ) def test_can_format_duration_column( self, testdir, duration_formatter, expected_report_content ): testdir.makeconftest( f""" import pytest @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item, call): outcome = yield report = outcome.get_result() setattr(report, "duration_formatter", "{duration_formatter}") """ ) sleep = float(0.2) testdir.makepyfile( """ import time def test_sleep(): time.sleep({:f}) """.format( sleep ) ) result, html = run(testdir) assert result.ret == 0 > assert_results(html, duration=sleep) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:157: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_can_format_duration_column0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_can_format_duration_column.py . [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_can_format_duration_column0/report.html - ============================== 1 passed in 0.22s =============================== ______________________________________ TestHTML.test_can_format_duration_column[%S.%f-\\d{2}\\.\\d{2}] _______________________________________ self = , testdir = duration_formatter = '%S.%f', expected_report_content = '\\d{2}\\.\\d{2}' @pytest.mark.parametrize( "duration_formatter,expected_report_content", [ ("%f", r'\d{2}'), ("%S.%f", r'\d{2}\.\d{2}'), ( "ABC%H %M %S123", r'ABC\d{2} \d{2} \d{2}123', ), ], ) def test_can_format_duration_column( self, testdir, duration_formatter, expected_report_content ): testdir.makeconftest( f""" import pytest @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item, call): outcome = yield report = outcome.get_result() setattr(report, "duration_formatter", "{duration_formatter}") """ ) sleep = float(0.2) testdir.makepyfile( """ import time def test_sleep(): time.sleep({:f}) """.format( sleep ) ) result, html = run(testdir) assert result.ret == 0 > assert_results(html, duration=sleep) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:157: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_can_format_duration_column1 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_can_format_duration_column.py . [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_can_format_duration_column1/report.html - ============================== 1 passed in 0.22s =============================== ___________________________ TestHTML.test_can_format_duration_column[ABC%H %M %S123-ABC\\d{2} \\d{2} \\d{2}123] ____________________________ self = , testdir = duration_formatter = 'ABC%H %M %S123', expected_report_content = 'ABC\\d{2} \\d{2} \\d{2}123' @pytest.mark.parametrize( "duration_formatter,expected_report_content", [ ("%f", r'\d{2}'), ("%S.%f", r'\d{2}\.\d{2}'), ( "ABC%H %M %S123", r'ABC\d{2} \d{2} \d{2}123', ), ], ) def test_can_format_duration_column( self, testdir, duration_formatter, expected_report_content ): testdir.makeconftest( f""" import pytest @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item, call): outcome = yield report = outcome.get_result() setattr(report, "duration_formatter", "{duration_formatter}") """ ) sleep = float(0.2) testdir.makepyfile( """ import time def test_sleep(): time.sleep({:f}) """.format( sleep ) ) result, html = run(testdir) assert result.ret == 0 > assert_results(html, duration=sleep) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:157: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_can_format_duration_column2 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_can_format_duration_column.py . [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_can_format_duration_column2/report.html - ============================== 1 passed in 0.22s =============================== ____________________________________________________________________________ TestHTML.test_pass ____________________________________________________________________________ self = , testdir = def test_pass(self, testdir): testdir.makepyfile("def test_pass(): pass") result, html = run(testdir) assert result.ret == 0 > assert_results(html) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:166: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_pass0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_pass.py . [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_pass0/report.html - ============================== 1 passed in 0.01s =============================== ____________________________________________________________________________ TestHTML.test_skip ____________________________________________________________________________ self = , testdir = def test_skip(self, testdir): reason = str(random.random()) testdir.makepyfile( f""" import pytest def test_skip(): pytest.skip('{reason}') """ ) result, html = run(testdir) assert result.ret == 0 > assert_results(html, tests=0, passed=0, skipped=1) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:179: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_skip0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_skip.py s [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_skip0/report.html - ============================== 1 skipped in 0.01s ============================== ____________________________________________________________________________ TestHTML.test_fail ____________________________________________________________________________ self = , testdir = def test_fail(self, testdir): testdir.makepyfile("def test_fail(): assert False") result, html = run(testdir) assert result.ret > assert_results(html, passed=0, failed=1) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:186: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n E assert False

test_fail.py:1: AssertionError
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_fail0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_fail.py F [100%] =================================== FAILURES =================================== __________________________________ test_fail ___________________________________ > def test_fail(): assert False E assert False test_fail.py:1: AssertionError - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_fail0/report.html - =========================== short test summary info ============================ FAILED test_fail.py::test_fail - assert False ============================== 1 failed in 0.01s =============================== ___________________________________________________________________________ TestHTML.test_rerun ____________________________________________________________________________ self = , testdir = def test_rerun(self, testdir): testdir.makeconftest( """ import pytest @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item, call): pytest_html = item.config.pluginmanager.getplugin("html") outcome = yield report = outcome.get_result() extra = getattr(report, "extra", []) if report.when == "call": extra.append(pytest_html.extras.url("http://www.example.com/")) report.extra = extra """ ) testdir.makepyfile( """ import pytest import time @pytest.mark.flaky(reruns=2) def test_example(): time.sleep(1) assert False """ ) result, html = run(testdir) assert result.ret > assert_results(html, passed=0, failed=1, rerun=2) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:221: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_rerun0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_rerun.py F [100%] =================================== FAILURES =================================== _________________________________ test_example _________________________________ @pytest.mark.flaky(reruns=2) def test_example(): time.sleep(1) > assert False E assert False test_rerun.py:7: AssertionError =============================== warnings summary =============================== test_rerun.py:4 /tmp/pytest-of-tkloczko/pytest-259/test_rerun0/test_rerun.py:4: PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html @pytest.mark.flaky(reruns=2) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_rerun0/report.html - =========================== short test summary info ============================ FAILED test_rerun.py::test_example - assert False ========================= 1 failed, 1 warning in 1.03s ========================= _____________________________________________________________________ TestHTML.test_conditional_xfails _____________________________________________________________________ self = , testdir = def test_conditional_xfails(self, testdir): testdir.makepyfile( """ import pytest @pytest.mark.xfail(False, reason='reason') def test_fail(): assert False @pytest.mark.xfail(False, reason='reason') def test_pass(): pass @pytest.mark.xfail(True, reason='reason') def test_xfail(): assert False @pytest.mark.xfail(True, reason='reason') def test_xpass(): pass """ ) result, html = run(testdir) assert result.ret > assert_results(html, tests=4, passed=1, failed=1, xfailed=1, xpassed=1) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:254: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_conditional_xfails0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 4 items test_conditional_xfails.py F.xX [100%] =================================== FAILURES =================================== __________________________________ test_fail ___________________________________ @pytest.mark.xfail(False, reason='reason') > def test_fail(): assert False E assert False test_conditional_xfails.py:3: AssertionError - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_conditional_xfails0/report.html - =========================== short test summary info ============================ FAILED test_conditional_xfails.py::test_fail - assert False ============== 1 failed, 1 passed, 1 xfailed, 1 xpassed in 0.02s =============== ________________________________________________________________________ TestHTML.test_setup_error _________________________________________________________________________ self = , testdir = def test_setup_error(self, testdir): testdir.makepyfile( """ import pytest @pytest.fixture def arg(request): raise ValueError() def test_function(arg): pass """ ) result, html = run(testdir) assert result.ret > assert_results(html, tests=0, passed=0, errors=1) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:269: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_setup_error0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_setup_error.py E [100%] ==================================== ERRORS ==================================== _______________________ ERROR at setup of test_function ________________________ request = > @pytest.fixture def arg(request): > raise ValueError() E ValueError test_setup_error.py:4: ValueError - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_setup_error0/report.html - =========================== short test summary info ============================ ERROR test_setup_error.py::test_function - ValueError =============================== 1 error in 0.01s =============================== ___________________________________________________________________________ TestHTML.test_xfail ____________________________________________________________________________ self = , testdir = def test_xfail(self, testdir): reason = str(random.random()) testdir.makepyfile( f""" import pytest def test_xfail(): pytest.xfail('{reason}') """ ) result, html = run(testdir) assert result.ret == 0 > assert_results(html, passed=0, xfailed=1) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:284: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_xfail0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_xfail.py x [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_xfail0/report.html - ============================== 1 xfailed in 0.01s ============================== ___________________________________________________________________________ TestHTML.test_xpass ____________________________________________________________________________ self = , testdir = def test_xpass(self, testdir): testdir.makepyfile( """ import pytest @pytest.mark.xfail() def test_xpass(): pass """ ) result, html = run(testdir) assert result.ret == 0 > assert_results(html, passed=0, xpassed=1) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:298: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_xpass0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_xpass.py X [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_xpass0/report.html - ============================== 1 xpassed in 0.01s ============================== _____________________________________________________________________ TestHTML.test_create_report_path _____________________________________________________________________ self = , testdir = def test_create_report_path(self, testdir): testdir.makepyfile("def test_pass(): pass") path = os.path.join("directory", "report.html") result, html = run(testdir, path) assert result.ret == 0 > assert_results(html) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:305: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_create_report_path0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_create_report_path.py . [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_create_report_path0/directory/report.html - ============================== 1 passed in 0.01s =============================== ___________________________________________________________ TestHTML.test_extra_image_separated_rerun[png-image] ___________________________________________________________ self = , testdir = file_extension = 'png', extra_type = 'image' @pytest.mark.parametrize( "file_extension, extra_type", [("png", "image"), ("png", "png"), ("svg", "svg"), ("jpg", "jpg")], ) def test_extra_image_separated_rerun(self, testdir, file_extension, extra_type): content = b64encode(b"foo").decode("ascii") testdir.makeconftest( f""" import pytest @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item, call): outcome = yield report = outcome.get_result() if report.when == 'call': from pytest_html import extras report.extra = [extras.{extra_type}('{content}')] """ ) testdir.makepyfile( """ import pytest @pytest.mark.flaky(reruns=2) def test_fail(): assert False""" ) result, html = run(testdir) for i in range(1, 4): asset_name = "test_extra_image_separated_rerun.py__test_fail" src = f"assets/{asset_name}_0_{i}.{file_extension}" link = f'' img = f'' assert result.ret > assert link in html E assert '' in '\n\n \n \n Test Report\n ' img = f'' assert result.ret > assert link in html E assert '' in '\n\n \n \n Test Report\n ' img = f'' assert result.ret > assert link in html E assert '' in '\n\n \n \n Test Report\n ' img = f'' assert result.ret > assert link in html E assert '' in '\n\n \n \n Test Report\n result, html = run(testdir, "report.html", "-n", "1") /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:770: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:42: in run return result, read_html(path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = local('/tmp/pytest-of-tkloczko/pytest-259/test_environment_xdist0/report.html') def read_html(path): > with open(str(path)) as f: E FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-tkloczko/pytest-259/test_environment_xdist0/report.html' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:46: FileNotFoundError --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...] pytest: error: unrecognized arguments: -n inifile: None rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_environment_xdist0 __________________________________________________________________ TestHTML.test_environment_xdist_reruns __________________________________________________________________ self = , testdir = def test_environment_xdist_reruns(self, testdir): content = str(random.random()) testdir.makeconftest( f""" def pytest_configure(config): for i in range(2): config._metadata['content'] = '{content}' """ ) testdir.makepyfile("def test_fail(): assert False") > result, html = run(testdir, "report.html", "-n", "1", "--reruns", "1") /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:785: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:42: in run return result, read_html(path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = local('/tmp/pytest-of-tkloczko/pytest-259/test_environment_xdist_reruns0/report.html') def read_html(path): > with open(str(path)) as f: E FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-tkloczko/pytest-259/test_environment_xdist_reruns0/report.html' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:46: FileNotFoundError --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...] pytest: error: unrecognized arguments: -n --reruns 1 inifile: None rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_environment_xdist_reruns0 ___________________________________________________________________ TestHTML.test_xdist_crashing_worker ____________________________________________________________________ self = , testdir = def test_xdist_crashing_worker(self, testdir): """https://github.com/pytest-dev/pytest-html/issues/21""" testdir.makepyfile( """ import os def test_exit(): os._exit(0) """ ) > result, html = run(testdir, "report.html", "-n", "1") /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:883: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:42: in run return result, read_html(path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = local('/tmp/pytest-of-tkloczko/pytest-259/test_xdist_crashing_worker0/report.html') def read_html(path): > with open(str(path)) as f: E FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-tkloczko/pytest-259/test_xdist_crashing_worker0/report.html' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:46: FileNotFoundError --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...] pytest: error: unrecognized arguments: -n inifile: None rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_xdist_crashing_worker0 _______________________________________________________________________ TestHTML.test_utf8_surrogate _______________________________________________________________________ self = , testdir = def test_utf8_surrogate(self, testdir): testdir.makepyfile( r""" import pytest @pytest.mark.parametrize('val', ['\ud800']) def test_foo(val): pass """ ) result, html = run(testdir) assert result.ret == 0 > assert_results(html, passed=1) /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:898: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:96: in assert_results assert_results_by_outcome(html, "rerun", rerun) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ html = '\n\n \n \n Test Report\n \n
No log output captured.
' test_outcome = 'rerun', test_outcome_number = 0, label = None def assert_results_by_outcome(html, test_outcome, test_outcome_number, label=None): # Asserts if the test number of this outcome in the summary is correct regex_summary = r"(\d)+ {}".format(label or test_outcome) > assert int(re.search(regex_summary, html).group(1)) == test_outcome_number E AttributeError: 'NoneType' object has no attribute 'group' /home/tkloczko/rpmbuild/BUILD/pytest-html-3.1.1/testing/test_pytest_html.py:53: AttributeError --------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------- ============================= test session starts ============================== platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /tmp/pytest-of-tkloczko/pytest-259/test_utf8_surrogate0 plugins: html-3.1.1, metadata-1.11.0, mock-3.8.1 collected 1 item test_utf8_surrogate.py . [100%] - generated html file: file:///tmp/pytest-of-tkloczko/pytest-259/test_utf8_surrogate0/report.html - ============================== 1 passed in 0.01s =============================== ______________________________________________________________________ TestHTML.test_ansi_color[True] ______________________________________________________________________ self = , testdir = mocker = , with_ansi = True @pytest.mark.parametrize( "with_ansi", [True, False], ) def test_ansi_color(self, testdir, mocker, with_ansi): if not with_ansi: mock_ansi_support = mocker.patch("pytest_html.plugin.ansi_support") mock_ansi_support.return_value = None pass_content = [ 'RCOLOR', 'GCOLOR', 'YCOLOR', ] testdir.makepyfile( r""" def test_ansi(): colors = ['\033[31mRCOLOR\033[0m', '\033[32mGCOLOR\033[0m', '\033[33mYCOLOR\033[0m'] for color in colors: print(color) """ ) result, html = run(testdir, "report.html", "--self-contained-html") assert result.ret == 0 for content in pass_content: if with_ansi: > assert content in html E assert 'RCOLOR' in '\n\n \n \n Test Report\n