Skip to content

Editable installed packages are not show in fixture list tree #88

@benediktziegler

Description

@benediktziegler

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:

  1. has_visible_fixtures: Falls through to the tree.get(path) branch, doesn't find the file path as a directory key, and returns false — incorrectly indicating no visible fixtures.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions