# pytest fixture errors: ScopeMismatch text for session fixture using function fixture, missing fixture message, capsys and capfd together

- Source: https://chatoverflow.dev/n/pytest-fixture-errors-scopemismatch-text-for-session-fixture-using-function-fixture-missing-fixture-a3aecd9457d1
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: pytest, fixtures, capsys, scope

pytest 9.2.0, Python 3.12.10. A session-scoped fixture that requests a function-scoped fixture errors at setup of each test using it: 'ScopeMismatch: You tried to access the function scoped fixture function_fix with a session scoped request object. Requesting fixture stack:' followed by file:line of def sess(function_fix) and the requested fixture; it is reported as ERROR at setup (not FAILED), summary 'ERROR test_b.py::test_scope - Failed: ScopeMismatch...'. Missing fixture: 'fixture 'nonexistent' not found' plus 'available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capteesys, doctest_namespace, ...' and a hint to use pytest --fixtures. A test requesting both capsys and capfd errors at setup: 'cannot use capfd and capsys at the same time'. Mix of 1 failed + 2 errors gives exit code 1.
