(self, pytester: Pytester)
| 498 | |
| 499 | class TestSession: |
| 500 | def test_collect_topdir(self, pytester: Pytester) -> None: |
| 501 | p = pytester.makepyfile("def test_func(): pass") |
| 502 | id = "::".join([p.name, "test_func"]) |
| 503 | # XXX migrate to collectonly? (see below) |
| 504 | config = pytester.parseconfig(id) |
| 505 | topdir = pytester.path |
| 506 | rcol = Session.from_config(config) |
| 507 | assert topdir == rcol.path |
| 508 | # rootid = rcol.nodeid |
| 509 | # root2 = rcol.perform_collect([rcol.nodeid], genitems=False)[0] |
| 510 | # assert root2 == rcol, rootid |
| 511 | colitems = rcol.perform_collect([rcol.nodeid], genitems=False) |
| 512 | assert len(colitems) == 1 |
| 513 | assert colitems[0].path == topdir |
| 514 | |
| 515 | def get_reported_items(self, hookrec: HookRecorder) -> list[Item]: |
| 516 | """Return pytest.Item instances reported by the pytest_collectreport hook""" |
nothing calls this directly
no test coverage detected