def _resolve_args(self, cache: FixtureCache) -> Dict[str, Any]: args_for_iteration = self._get_args_for_iteration() resolved_args: Dict[str, Any] = {} for name, arg in args_for_iteration.items(): if is_fixture(arg): resolved = self._resolve_single_arg(arg, cache) else: resolved = arg resolved_args[name] = resolved return self._unpack_resolved(resolved_args)
def fixtures(self) -> Dict[str, Fixture]: return { name: Fixture(arg) for name, arg in self._get_args_for_iteration().items() if is_fixture(arg) }
def _(not_fixture=each("foo", 5, is_fixture, Fixture)): assert not is_fixture(not_fixture)
def _(): # I would have liked to combine this test into the parameterised test below, # but if we put the fixture in the each, it would get resolved! # So we need to check it from global scope. assert is_fixture(dummy_fixture)