MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_test_report

Method test_test_report

testing/test_reports.py:422–442  ·  view source on GitHub ↗
(self, pytester: Pytester, pytestconfig: Config)

Source from the content-addressed store, hash-verified

420 """Test that the hooks are working correctly for plugins"""
421
422 def test_test_report(self, pytester: Pytester, pytestconfig: Config) -> None:
423 pytester.makepyfile(
424 """
425 def test_a(): assert False
426 def test_b(): pass
427 """
428 )
429 reprec = pytester.inline_run()
430 reports = reprec.getreports("pytest_runtest_logreport")
431 assert len(reports) == 6
432 for rep in reports:
433 data = pytestconfig.hook.pytest_report_to_serializable(
434 config=pytestconfig, report=rep
435 )
436 assert data["$report_type"] == "TestReport"
437 new_rep = pytestconfig.hook.pytest_report_from_serializable(
438 config=pytestconfig, data=data
439 )
440 assert new_rep.nodeid == rep.nodeid
441 assert new_rep.when == rep.when
442 assert new_rep.outcome == rep.outcome
443
444 def test_collect_report(self, pytester: Pytester, pytestconfig: Config) -> None:
445 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

makepyfileMethod · 0.45
inline_runMethod · 0.45
getreportsMethod · 0.45

Tested by

no test coverage detected