| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…th overrides and parametrization Based on existing tests, just adding the parametrization. Refs pytest-dev#14248.
…n_ordering No functional changes, just making it easier to follow.
…es without monkeypatching Seems better to avoid this monkeypatch-pytest-to-smuggle-info-out-of-pytester pattern.
… from overridden fixtures As the xfail'ed test `test_fixture_closure_with_overrides_and_parametrization` demonstrates, adding any direct parametrization causes the statically computed fixture closure to omit transitive dependencies from overridden (but still requested) fixtures. (The dynamic algorithm does get it right). The `prune_dependency_tree()` function did not account for overridden fixtures properly (only checked `-1`). Make it share the core recursive DFS traversal used by `getfixtureclosure()`, which already fixed a similar problem (pytest-dev#13789). An alternative solution is to replace `prune_dependency_tree` wholesale with another call to `getfixtureclosure`, as proposed in PR pytest-dev#11243, however it's somewhat harder to get working, so let's go with this solution for now. Fix pytest-dev#14248
Didn't include this in the previous commit, in case it causes regressions.
(I am talking here about `names_closure`/`fixturenames`.) Before 72ae3db, the static traversal order was BFS (unlike the dynamic order which is DFS). So it was natural that `initialnames` was always at the beginning of the closure, since it consists the initial working set. When we changed to DFS, we kept this. But it's a bit weird, now the initialnames are in BFS, but all transitive dependencies are in DFS. Remove this special case, making both the static and dynamic order fully DFS.
| Back | FazBrowse Home | New Git URL |
This PR fixes #14248.
The 1st commit adds the xfailed test from @smarie in the issue.
The 2nd and 3rd commits do some related test cleanup.
The 4th commit is the actual fix. Basically, just making prune_dependency_tree use the same underlying code as the already-fixed getfixtureclosure.
The 5th commit is some optimizations that I split to make the previous commit minimal.
The 6th commit is a bit of a consistency fix and optimization, changing the static fixture order to fully DFS like the dynamic one.