(self, pytester: Pytester)
| 94 | assert fn.function is not None |
| 95 | |
| 96 | def test_getcustomfile_roundtrip(self, pytester: Pytester) -> None: |
| 97 | hello = pytester.makefile(".xxx", hello="world") |
| 98 | pytester.makepyfile( |
| 99 | conftest=""" |
| 100 | import pytest |
| 101 | class CustomFile(pytest.File): |
| 102 | pass |
| 103 | def pytest_collect_file(file_path, parent): |
| 104 | if file_path.suffix == ".xxx": |
| 105 | return CustomFile.from_parent(path=file_path, parent=parent) |
| 106 | """ |
| 107 | ) |
| 108 | node = pytester.getpathnode(hello) |
| 109 | assert isinstance(node, pytest.File) |
| 110 | assert node.name == "hello.xxx" |
| 111 | nodes = node.session.perform_collect([node.nodeid], genitems=False) |
| 112 | assert len(nodes) == 1 |
| 113 | assert isinstance(nodes[0], pytest.File) |
| 114 | |
| 115 | def test_can_skip_class_with_test_attr(self, pytester: Pytester) -> None: |
| 116 | """Assure test class is skipped when using `__test__=False` (See #2007).""" |
nothing calls this directly
no test coverage detected