-
Notifications
You must be signed in to change notification settings - Fork 7
Description
The Problem
Both has_visible_fixtures and print_tree_node use path.is_file() to determine whether a path is a file (with fixtures) or a directory (with children). When editable install paths get remapped — e.g., from /home/user/projects/some-lib/conftest.py to /path/to/venv/lib/site-packages/some_lib/conftest.py — these virtual paths don't exist on disk. So path.is_file() returns false for remapped file paths, causing:
has_visible_fixtures: Falls through to thetree.get(path)branch, doesn't find the file path as a directory key, and returnsfalse— incorrectly indicating no visible fixtures.print_tree_node: Same issue — the file's fixtures are never rendered because the code thinks it's not a file.
A possible Fix
Replace path.is_file() with file_fixtures.contains_key(path) in both functions (lines 283 and 431). This makes the check data-driven (based on what's actually in the fixture map) rather than filesystem-driven (based on what exists on disk). Since file_fixtures already has the remapped paths as keys, this correctly identifies them as fixture files regardless of whether the physical path exists.