예제 #1
0
파일: testing.py 프로젝트: mkuyper/ward
 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)
예제 #2
0
파일: testing.py 프로젝트: mkuyper/ward
 def fixtures(self) -> Dict[str, Fixture]:
     return {
         name: Fixture(arg)
         for name, arg in self._get_args_for_iteration().items()
         if is_fixture(arg)
     }
예제 #3
0
def _(not_fixture=each("foo", 5, is_fixture, Fixture)):
    assert not is_fixture(not_fixture)
예제 #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)