(self, pytester: Pytester)
| 295 | |
| 296 | class TestReRunTests: |
| 297 | def test_rerun(self, pytester: Pytester) -> None: |
| 298 | pytester.makeconftest( |
| 299 | """ |
| 300 | from _pytest.runner import runtestprotocol |
| 301 | def pytest_runtest_protocol(item, nextitem): |
| 302 | runtestprotocol(item, log=False, nextitem=nextitem) |
| 303 | runtestprotocol(item, log=True, nextitem=nextitem) |
| 304 | """ |
| 305 | ) |
| 306 | pytester.makepyfile( |
| 307 | """ |
| 308 | import pytest |
| 309 | count = 0 |
| 310 | req = None |
| 311 | @pytest.fixture |
| 312 | def fix(request): |
| 313 | global count, req |
| 314 | assert request != req |
| 315 | req = request |
| 316 | print("fix count %s" % count) |
| 317 | count += 1 |
| 318 | def test_fix(fix): |
| 319 | pass |
| 320 | """ |
| 321 | ) |
| 322 | result = pytester.runpytest("-s") |
| 323 | result.stdout.fnmatch_lines( |
| 324 | """ |
| 325 | *fix count 0* |
| 326 | *fix count 1* |
| 327 | """ |
| 328 | ) |
| 329 | result.stdout.fnmatch_lines( |
| 330 | """ |
| 331 | *2 passed* |
| 332 | """ |
| 333 | ) |
| 334 | |
| 335 | |
| 336 | def test_pytestconfig_is_session_scoped() -> None: |
nothing calls this directly
no test coverage detected