(self, pytester: Pytester)
| 468 | |
| 469 | class TestSession: |
| 470 | def test_collect_topdir(self, pytester: Pytester) -> None: |
| 471 | p = pytester.makepyfile("def test_func(): pass") |
| 472 | id = "::".join([p.name, "test_func"]) |
| 473 | # XXX migrate to collectonly? (see below) |
| 474 | config = pytester.parseconfig(id) |
| 475 | topdir = pytester.path |
| 476 | rcol = Session.from_config(config) |
| 477 | assert topdir == rcol.path |
| 478 | # rootid = rcol.nodeid |
| 479 | # root2 = rcol.perform_collect([rcol.nodeid], genitems=False)[0] |
| 480 | # assert root2 == rcol, rootid |
| 481 | colitems = rcol.perform_collect([rcol.nodeid], genitems=False) |
| 482 | assert len(colitems) == 1 |
| 483 | assert colitems[0].path == p |
| 484 | |
| 485 | def get_reported_items(self, hookrec: HookRecorder) -> List[Item]: |
| 486 | """Return pytest.Item instances reported by the pytest_collectreport hook""" |
nothing calls this directly
no test coverage detected