pytest
686f9e07 - fixtures: remove unneeded optimization from `_getnextfixturedef`

Commit
1 year ago
fixtures: remove unneeded optimization from `_getnextfixturedef` According to my understanding, this code, which handles obtaining the relevant fixturedefs when a dynamic `getfixturevalue` is used, has an optimization where it only grabs fixturedefs that are visible to the *parent* of the item, instead of the item itself, under the assumption that a fixturedef can't be visible to a single item, only to a collector. Remove this optimization for the following reasons: - It doesn't save much (one loop iteration in `matchfactories`) - It slightly complicates the complex fixtures code - If some plugin wants to make a fixture visible only to a single item, why not let it? - In the static case (`getfixtureclosure`), this optimization is not done (despite the confusing name `parentnode`, it is *not* the parent node). This is inconsistent.
Author
Committer
Parents
Loading