Install pytest-html and then run test with --html=pytest_report.html option.

Answer from brada on Stack Overflow
🌐
pytest
docs.pytest.org › en › stable › _modules › _pytest › reports.html
_pytest.reports - pytest documentation
[docs] class TestReport(BaseReport): """Basic test report object (also used for setup and teardown calls if they fail). Reports can contain arbitrary extra attributes. """ __test__ = False # Defined by skipping plugin. # xfail reason if xfailed, otherwise not defined.
🌐
pytest
docs.pytest.org › en › stable › reference › reference.html
API Reference - pytest documentation
matchreport(inamepart='', names=('pytest_runtest_logreport', 'pytest_collectreport'), when=None)[source]¶ · Return a testreport whose dotted import path matches.
🌐
Neetz World
neetabirajdar.github.io › blog › tech_pytest_report
Test Report With Pytest - Neetz World
April 2, 2023 - Pytest-sugar is a plugin for pytest that shows failures and errors instantly and shows a progress bar.
🌐
pytest
docs.pytest.org › en › 7.1.x › _modules › _pytest › reports.html
_pytest.reports — pytest documentation
""" kwargs = _report_kwargs_from_json(reportdict) return cls(**kwargs) def _report_unserialization_failure( type_name: str, report_class: Type[BaseReport], reportdict ) -> "NoReturn": url = "https://github.com/pytest-dev/pytest/issues" stream = StringIO() pprint("-" * 100, stream=stream) pprint("INTERNALERROR: Unknown entry type returned: %s" % type_name, stream=stream) pprint("report_name: %s" % report_class, stream=stream) pprint(reportdict, stream=stream) pprint("Please report this bug at %s" % url, stream=stream) pprint("-" * 100, stream=stream) raise RuntimeError(stream.getvalue()) [docs]@final class TestReport(BaseReport): """Basic test report object (also used for setup and teardown calls if they fail).
🌐
pytest
docs.pytest.org › en › 7.1.x › reference › reference.html
API Reference — pytest documentation
matchreport(inamepart='', names=('pytest_runtest_logreport', 'pytest_collectreport'), when=None)[source]¶ · Return a testreport whose dotted import path matches.
🌐
AWS
docs.aws.amazon.com › aws codebuild › user guide › test reports in aws codebuild › test frameworks › set up test reporting with pytest
Set up test reporting with pytest - AWS CodeBuild
version: 0.2 phases: install: runtime-versions: python: 3.7 commands: - pip3 install pytest build: commands: - python -m pytest --junitxml=<test report directory>/<report filename> reports: pytest_reports: files: - <report filename> base-directory: <test report directory> file-format: JUNITXML
Find elsewhere
🌐
Readthedocs
happytest-apidoc.readthedocs.io › en › latest › api › _pytest.reports
_pytest.reports module — pytest API documentation
class TestReport(nodeid, location: Tuple[str, Optional[int], str], keywords, outcome, longrepr, when, sections=(), duration=0, user_properties=None, **extra)[source]¶ · Bases: _pytest.reports.BaseReport · Basic test report object (also used for setup and teardown calls if they fail).
🌐
Readthedocs
pytest-cov.readthedocs.io › en › latest › reporting.html
Reporting - pytest-cov 7.1.0 documentation
pytest --cov-report=term-missing --cov=myproj tests/ -------------------- coverage: platform linux2, python 2.6.4-final-0 --------------------- Name Stmts Miss Cover Missing -------------------------------------------------- myproj/__init__ 2 0 100% myproj/myproj 257 13 94% 24-26, 99, 149, 233-236, 297-298, 369-370 myproj/feature4286 94 7 92% 183-188, 197 -------------------------------------------------- TOTAL 353 20 94%
🌐
GitHub
github.com › pytest-dev › pytest-reportlog
GitHub - pytest-dev/pytest-reportlog: Replacement for the --resultlog option, focused in simplicity and extensibility · GitHub
$ pytest test_report_example.py -q --report-log=log.jsonl .F [100%] ================================= FAILURES ================================= ________________________________ test_fail _________________________________ def test_fail(): > assert 4 + 4 == 1 E assert (4 + 4) == 1 test_report_example.py:8: AssertionError ------------------- generated report log file: log.jsonl -------------------- 1 failed, 1 passed in 0.12s
Starred by 102 users
Forked by 22 users
Languages   Python
🌐
PyPI
pypi.org › project › pytest-json-report
pytest-json-report · PyPI
A pytest plugin to report test results as JSON files
      » pip install pytest-json-report
    
Published   Mar 15, 2022
Version   1.5.0
🌐
pytest
docs.pytest.org › en › stable › _modules › _pytest › pytester.html
_pytest.pytester - pytest documentation
[docs] def matchreport( self, inamepart: str = "", names: str | Iterable[str] = ( "pytest_runtest_logreport", "pytest_collectreport", ), when: str | None = None, ) -> CollectReport | TestReport: """Return a testreport whose dotted import path matches.""" values = [] for rep in self.getreports(names=names): if not when and rep.when != "call" and rep.passed: # setup/teardown passing reports - let's ignore those continue if when and rep.when != when: continue if not inamepart or inamepart in rep.nodeid.split("::"): values.append(rep) if not values: raise ValueError( f"could not find test report matching {inamepart!r}: " "no test reports at all!"
🌐
PyPI
pypi.org › project › pytest-reporter
pytest-reporter · PyPI
Generate Pytest reports from templates.
      » pip install pytest-reporter
    
Published   Feb 28, 2024
Version   0.5.3
🌐
PyPI
pypi.org › project › pytest-md-report
pytest-md-report · PyPI
A pytest plugin to generate test outcomes reports with markdown table format.
      » pip install pytest-md-report
    
Published   May 02, 2025
Version   0.7.0
🌐
PyPI
pypi.org › project › pytest-reporter-html
pytest-reporter-html · PyPI
A pytest plugin that automatically generates rich, interactive HTML test reports with zero-config log capture, named step tracking, exception rendering, and real-time filtering — open the file in any browser and start debugging.
      » pip install pytest-reporter-html
    
Published   Mar 15, 2026
Version   2.4.0
🌐
PyPI
pypi.org › project › pytest-testreport-new
pytest-testreport-new · PyPI
pytest-testreport-new是一个针对pytest的生成html报告的插件,基于开源工具pytest-testreport的修改,使用起来非常简单,安装好pytest-testreport-new之后,运行用例时加上参数即可生成报告
      » pip install pytest-testreport-new
    
Published   Oct 07, 2023
Version   0.0.6