(pytester: Pytester)
| 4455 | |
| 4456 | |
| 4457 | def test_yield_fixture_with_no_value(pytester: Pytester) -> None: |
| 4458 | pytester.makepyfile( |
| 4459 | """ |
| 4460 | import pytest |
| 4461 | @pytest.fixture(name='custom') |
| 4462 | def empty_yield(): |
| 4463 | if False: |
| 4464 | yield |
| 4465 | |
| 4466 | def test_fixt(custom): |
| 4467 | pass |
| 4468 | """ |
| 4469 | ) |
| 4470 | expected = "E ValueError: custom did not yield a value" |
| 4471 | result = pytester.runpytest() |
| 4472 | result.assert_outcomes(errors=1) |
| 4473 | result.stdout.fnmatch_lines([expected]) |
| 4474 | assert result.ret == ExitCode.TESTS_FAILED |
nothing calls this directly
no test coverage detected