MCPcopy
hub / github.com/pytest-dev/pytest / test_collect_result

Method test_collect_result

testing/test_runner.py:531–552  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

529
530class TestSessionReports:
531 def test_collect_result(self, pytester: Pytester) -> None:
532 col = pytester.getmodulecol(
533 """
534 def test_func1():
535 pass
536 class TestClass(object):
537 pass
538 """
539 )
540 rep = runner.collect_one_node(col)
541 assert not rep.failed
542 assert not rep.skipped
543 assert rep.passed
544 locinfo = rep.location
545 assert locinfo is not None
546 assert locinfo[0] == col.path.name
547 assert not locinfo[1]
548 assert locinfo[2] == col.path.name
549 res = rep.result
550 assert len(res) == 2
551 assert res[0].name == "test_func1"
552 assert res[1].name == "TestClass"
553
554
555reporttypes: list[type[reports.BaseReport]] = [

Callers

nothing calls this directly

Calls 1

getmodulecolMethod · 0.45

Tested by

no test coverage detected