(self, pytester: Pytester)
| 516 | assert [x.name for x in self.get_reported_items(hookrec)] == ["test_func"] |
| 517 | |
| 518 | def test_collect_protocol_method(self, pytester: Pytester) -> None: |
| 519 | p = pytester.makepyfile( |
| 520 | """ |
| 521 | class TestClass(object): |
| 522 | def test_method(self): |
| 523 | pass |
| 524 | """ |
| 525 | ) |
| 526 | normid = p.name + "::TestClass::test_method" |
| 527 | for id in [p.name, p.name + "::TestClass", normid]: |
| 528 | items, hookrec = pytester.inline_genitems(id) |
| 529 | assert len(items) == 1 |
| 530 | assert items[0].name == "test_method" |
| 531 | newid = items[0].nodeid |
| 532 | assert newid == normid |
| 533 | # ensure we are reporting the collection of the single test item (#2464) |
| 534 | assert [x.name for x in self.get_reported_items(hookrec)] == ["test_method"] |
| 535 | |
| 536 | def test_collect_custom_nodes_multi_id(self, pytester: Pytester) -> None: |
| 537 | p = pytester.makepyfile("def test_func(): pass") |
nothing calls this directly
no test coverage detected