Recompute names_closure from initialnames and name2fixturedefs. Can only reduce names_closure, which means that the new closure will always be a subset of the old one. The order is preserved. This method is needed because direct parametrization may shadow some of th
(self)
| 418 | name2fixturedefs: dict[str, Sequence[FixtureDef[Any]]] |
| 419 | |
| 420 | def prune_dependency_tree(self) -> None: |
| 421 | """Recompute names_closure from initialnames and name2fixturedefs. |
| 422 | |
| 423 | Can only reduce names_closure, which means that the new closure will |
| 424 | always be a subset of the old one. The order is preserved. |
| 425 | |
| 426 | This method is needed because direct parametrization may shadow some |
| 427 | of the fixtures that were included in the originally built dependency |
| 428 | tree. In this way the dependency tree can get pruned, and the closure |
| 429 | of argnames may get reduced. |
| 430 | """ |
| 431 | closure = set( |
| 432 | traverse_fixture_closure( |
| 433 | self.initialnames, |
| 434 | getfixturedefs=self.name2fixturedefs.get, |
| 435 | ) |
| 436 | ) |
| 437 | self.names_closure[:] = (name for name in self.names_closure if name in closure) |
| 438 | |
| 439 | |
| 440 | class FixtureRequest(abc.ABC): |
no test coverage detected