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