Beispiel #1
0
 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)
Beispiel #2
0
 def fixtures(self) -> Dict[str, Fixture]:
     return {
         name: Fixture(arg)
         for name, arg in self._get_args_for_iteration().items()
         if is_fixture(arg)
     }
Beispiel #3
0
def _(not_fixture=each("foo", 5, is_fixture, Fixture)):
    assert not is_fixture(not_fixture)
Beispiel #4
0
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)