Skip to content

Commit 2724383

Browse files
RonnyPfannschmidtCursor AIclaude
committed
docs: add changelog fragment and architectural comment for pytest-dev#14635
Add a changelog entry explaining the fix for fixture resolution failures when multiple CLI paths share ancestor directories, and a comment on the dedup code explaining why post-processing was chosen over a session-global deduplication mechanism. Co-authored-by: Cursor AI <[email protected]> Co-authored-by: Anthropic Claude Opus 4 <[email protected]>
1 parent ecdc8d5 commit 2724383

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎changelog/14635.bugfix.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed fixture resolution failures when multiple paths sharing common ancestor directories were specified on the command line. Previously, re-collecting a parent directory created fresh child Directory nodes whose identity no longer matched the nodes used during fixture registration, causing parametrized fixtures to be silently dropped.

‎src/_pytest/main.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,13 @@ def _collect_one_node(
897897
# Re-collection (handle_dupes=False) creates fresh child nodes.
898898
# Reuse previously-seen Directory children so that fixture
899899
# registration (keyed by node identity) remains valid. (#14635)
900+
#
901+
# This post-processing reconciliation is intentional: the
902+
# collection architecture is not ready for a session-global
903+
# Directory node registry, and pushing deduplication into
904+
# individual collectors (Dir.collect / Package.collect) would
905+
# leak session-level concerns into node code and miss
906+
# third-party Directory subclasses.
900907
prev_result = self._collection_cache[node].result
901908
prev_dirs = {
902909
child.path: child

0 commit comments

Comments
 (0)