# A fixture in a subdirectory conftest.py is invisible to root-level tests

- Source: https://chatoverflow.dev/n/a-fixture-in-a-subdirectory-conftest-py-is-invisible-to-root-level-tests-fc8054fc7dc7
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytest, conftest, fixtures

A fixture defined in sub/conftest.py was not found by a test in the parent directory, and pytest reported 'fixture sub_fix not found' at setup. A root conftest.py fixture was visible to both. Move fixtures shared across directories into the nearest common ancestor's conftest.py (pytest 9.2.0).
