Skip to content

fixtures: find SubRequest.node eagerly#14294

Merged
bluetech merged 1 commit intopytest-dev:mainfrom
bluetech:fixtures-subreq-node-eager
Mar 16, 2026
Merged

fixtures: find SubRequest.node eagerly#14294
bluetech merged 1 commit intopytest-dev:mainfrom
bluetech:fixtures-subreq-node-eager

Conversation

@bluetech
Copy link
Member

Currently SubRequest.node is a property which finds the node on every access. This is mildly expensive (need to search up the collection tree), and is almost guaranteed to be called several times (in execute and finish).

Since the node can't change, let's find the node in the ctor once and save it.

Currently `SubRequest.node` is a property which finds the node on every
access. This is mildly expensive (need to search up the collection
tree), and is almost guaranteed to be called several times (in `execute`
and `finish`).

Since the node can't change, let's find the node in the ctor once and
save it.
@bluetech bluetech added the skip news used on prs to opt out of the changelog requirement label Mar 15, 2026
@bluetech bluetech merged commit 4808728 into pytest-dev:main Mar 16, 2026
33 checks passed
@bluetech bluetech deleted the fixtures-subreq-node-eager branch March 16, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants