Check if an error is raised if a fixture function is called directly (#4545)
()
| 4284 | |
| 4285 | |
| 4286 | def test_call_fixture_function_error(): |
| 4287 | """Check if an error is raised if a fixture function is called directly (#4545)""" |
| 4288 | |
| 4289 | @pytest.fixture |
| 4290 | def fix(): |
| 4291 | raise NotImplementedError() |
| 4292 | |
| 4293 | with pytest.raises(pytest.fail.Exception): |
| 4294 | assert fix() == 1 |
| 4295 | |
| 4296 | |
| 4297 | def test_fixture_param_shadowing(pytester: Pytester) -> None: |