(self)
| 8 | |
| 9 | class ManifestDirectory(pytest.Directory): |
| 10 | def collect(self): |
| 11 | # The standard pytest behavior is to loop over all `test_*.py` files and |
| 12 | # call `pytest_collect_file` on each file. This collector instead reads |
| 13 | # the `manifest.json` file and only calls `pytest_collect_file` for the |
| 14 | # files defined there. |
| 15 | manifest_path = self.path / "manifest.json" |
| 16 | manifest = json.loads(manifest_path.read_text(encoding="utf-8")) |
| 17 | ihook = self.ihook |
| 18 | for file in manifest["files"]: |
| 19 | yield from ihook.pytest_collect_file( |
| 20 | file_path=self.path / file, parent=self |
| 21 | ) |
| 22 | |
| 23 | |
| 24 | @pytest.hookimpl |
nothing calls this directly
no test coverage detected