(pytester: Pytester)
| 290 | |
| 291 | |
| 292 | def test_deselect(pytester: Pytester) -> None: |
| 293 | pytester.makepyfile( |
| 294 | test_a=""" |
| 295 | import pytest |
| 296 | |
| 297 | def test_a1(): pass |
| 298 | |
| 299 | @pytest.mark.parametrize('b', range(3)) |
| 300 | def test_a2(b): pass |
| 301 | |
| 302 | class TestClass: |
| 303 | def test_c1(self): pass |
| 304 | |
| 305 | def test_c2(self): pass |
| 306 | """ |
| 307 | ) |
| 308 | result = pytester.runpytest( |
| 309 | "-v", |
| 310 | "--deselect=test_a.py::test_a2[1]", |
| 311 | "--deselect=test_a.py::test_a2[2]", |
| 312 | "--deselect=test_a.py::TestClass::test_c1", |
| 313 | ) |
| 314 | assert result.ret == 0 |
| 315 | result.stdout.fnmatch_lines(["*3 passed, 3 deselected*"]) |
| 316 | for line in result.stdout.lines: |
| 317 | assert not line.startswith(("test_a.py::test_a2[1]", "test_a.py::test_a2[2]")) |
| 318 | |
| 319 | |
| 320 | def test_sessionfinish_with_start(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected