(self, pytester: Pytester)
| 161 | ) |
| 162 | |
| 163 | def test_skip_file_by_conftest(self, pytester: Pytester) -> None: |
| 164 | pytester.makepyfile( |
| 165 | conftest=""" |
| 166 | import pytest |
| 167 | def pytest_collect_file(): |
| 168 | pytest.skip("intentional") |
| 169 | """, |
| 170 | test_file=""" |
| 171 | def test_one(): pass |
| 172 | """, |
| 173 | ) |
| 174 | try: |
| 175 | reprec = pytester.inline_run(pytester.path) |
| 176 | except pytest.skip.Exception: # pragma: no cover |
| 177 | pytest.fail("wrong skipped caught") |
| 178 | reports = reprec.getreports("pytest_collectreport") |
| 179 | # Session, Dir |
| 180 | assert len(reports) == 2 |
| 181 | assert reports[1].skipped |
| 182 | |
| 183 | |
| 184 | class TestNewSession(SessionTests): |
nothing calls this directly
no test coverage detected