(self, pytester: Pytester)
| 338 | |
| 339 | class TestCustomConftests: |
| 340 | def test_ignore_collect_path(self, pytester: Pytester) -> None: |
| 341 | pytester.makeconftest( |
| 342 | """ |
| 343 | def pytest_ignore_collect(collection_path, config): |
| 344 | return collection_path.name.startswith("x") or collection_path.name == "test_one.py" |
| 345 | """ |
| 346 | ) |
| 347 | sub = pytester.mkdir("xy123") |
| 348 | ensure_file(sub / "test_hello.py").write_text("syntax error") |
| 349 | sub.joinpath("conftest.py").write_text("syntax error") |
| 350 | pytester.makepyfile("def test_hello(): pass") |
| 351 | pytester.makepyfile(test_one="syntax error") |
| 352 | result = pytester.runpytest("--fulltrace") |
| 353 | assert result.ret == 0 |
| 354 | result.stdout.fnmatch_lines(["*1 passed*"]) |
| 355 | |
| 356 | def test_ignore_collect_not_called_on_argument(self, pytester: Pytester) -> None: |
| 357 | pytester.makeconftest( |
nothing calls this directly
no test coverage detected