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(
15081508 def dependent_fixtures_argnames (
15091509 fixture_defs : Sequence [FixtureDef [Any ]],
15101510 ) -> List [str ]:
1511- last_fixture = fixture_defs [- 1 ]
15121511 # 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 :
15181519 if argname not in dependent_argnames :
15191520 dependent_argnames .append (argname )
1521+ else :
1522+ break
15201523 return dependent_argnames
15211524
15221525 fixturenames_closure = list (initialnames )
You can’t perform that action at this time.
0 commit comments