(self, pytester: Pytester)
| 368 | |
| 369 | class TestCustomConftests: |
| 370 | def test_ignore_collect_path(self, pytester: Pytester) -> None: |
| 371 | pytester.makeconftest( |
| 372 | """ |
| 373 | def pytest_ignore_collect(collection_path, config): |
| 374 | return collection_path.name.startswith("x") or collection_path.name == "test_one.py" |
| 375 | """ |
| 376 | ) |
| 377 | sub = pytester.mkdir("xy123") |
| 378 | ensure_file(sub / "test_hello.py").write_text("syntax error", encoding="utf-8") |
| 379 | sub.joinpath("conftest.py").write_text("syntax error", encoding="utf-8") |
| 380 | pytester.makepyfile("def test_hello(): pass") |
| 381 | pytester.makepyfile(test_one="syntax error") |
| 382 | result = pytester.runpytest("--fulltrace") |
| 383 | assert result.ret == 0 |
| 384 | result.stdout.fnmatch_lines(["*1 passed*"]) |
| 385 | |
| 386 | def test_ignore_collect_not_called_on_argument(self, pytester: Pytester) -> None: |
| 387 | pytester.makeconftest( |
nothing calls this directly
no test coverage detected