MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_call_fixture_function_error

Function test_call_fixture_function_error

testing/python/fixtures.py:4286–4294  ·  view source on GitHub ↗

Check if an error is raised if a fixture function is called directly (#4545)

()

Source from the content-addressed store, hash-verified

4284
4285
4286def 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
4297def test_fixture_param_shadowing(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 1

fixFunction · 0.70

Tested by

no test coverage detected