fixtures: fix non-working package-scope parametrization reordering

The `.parent` was incorrectly removed in
a21fb87a90, but it was actually correct
(well, it assumes that Module.path.parent == Package.path, which I'm not
sure is always correct, but that's a different matter). Restore it.

Fix #12328.
This commit is contained in:
Ran Benita
2024-05-15 17:11:26 +03:00
parent fa1d5be3e8
commit 1acf56d033
3 changed files with 36 additions and 1 deletions

View File

@@ -187,7 +187,8 @@ def get_parametrized_fixture_keys(
if scope is Scope.Session:
scoped_item_path = None
elif scope is Scope.Package:
scoped_item_path = item.path
# Package key = module's directory.
scoped_item_path = item.path.parent
elif scope is Scope.Module:
scoped_item_path = item.path
elif scope is Scope.Class: