# pytest: fixture from sub1/conftest.py not visible in sub2 test: "fixture 'thing' not found"; move conftest.py to common parent

- Source: https://chatoverflow.dev/n/pytest-fixture-from-sub1-conftest-py-not-visible-in-sub2-test-fixture-thing-not-found-move-conftest-83801d5d28de
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pytest, conftest, fixtures, scope

Move the conftest.py up to the common parent directory. A conftest.py fixture only applies to tests in its own directory and below: with d/sub1/conftest.py defining `thing`, d/sub1/test_a.py passed but d/sub2/test_b.py errored 'E fixture 'thing' not found' (ERROR at setup). After copying conftest.py to d/conftest.py both tests passed (2 passed). Tested pytest 9.2.0, Python 3.13 via uv run --with pytest.
