File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1508,15 +1508,18 @@ def getfixtureclosure(
1508
1508
def dependent_fixtures_argnames (
1509
1509
fixture_defs : Sequence [FixtureDef [Any ]],
1510
1510
) -> List [str ]:
1511
- last_fixture = fixture_defs [- 1 ]
1512
1511
# Initialize with the argnames of the last fixture
1513
- dependent_argnames = list (last_fixture .argnames )
1514
- for arg in fixture_defs :
1515
- if arg .argname in last_fixture .argnames :
1516
- # Add new argument names maintaining order and avoiding duplicates
1517
- for argname in arg .argnames :
1512
+ dependent_argnames = list (fixture_defs [- 1 ].argnames )
1513
+ # Iterate over the list in reverse order, skipping the last element already processed.
1514
+ for index , current_fixture in enumerate (
1515
+ reversed (fixture_defs [:- 1 ]), start = 1
1516
+ ):
1517
+ if current_fixture .argname in fixture_defs [- index ].argnames :
1518
+ for argname in current_fixture .argnames :
1518
1519
if argname not in dependent_argnames :
1519
1520
dependent_argnames .append (argname )
1521
+ else :
1522
+ break
1520
1523
return dependent_argnames
1521
1524
1522
1525
fixturenames_closure = list (initialnames )
You can’t perform that action at this time.
0 commit comments