testing/example_scripts/issue88_initial_file_multinodes/conftest.py
raw| 1 | # mypy: allow-untyped-defs |
| 2 | from __future__ import annotations |
| 3 | |
| 4 | import pytest |
| 5 | |
| 6 | |
| 7 | class MyFile(pytest.File): |
| 8 | def collect(self): |
| 9 | return [MyItem.from_parent(name="hello", parent=self)] |
| 10 | |
| 11 | |
| 12 | def pytest_collect_file(file_path, parent): |
| 13 | return MyFile.from_parent(path=file_path, parent=parent) |
| 14 | |
| 15 | |
| 16 | class MyItem(pytest.Item): |
| 17 | def runtest(self): |
| 18 | raise NotImplementedError() |