def test_multiget_invalid_types() -> None: with pytest.raises( expected_exception=TypeError, match=re.escape("Unexpected MultiGet argument types: Get(AClass, BClass, ...), 'bob'"), ): next( MultiGet(Get(AClass, BClass()), "bob").__await__() # type: ignore[call-overload] )
def test_multiget_invalid_Nones() -> None: with pytest.raises( expected_exception=ValueError, match=re.escape("Unexpected MultiGet None arguments: None, Get(AClass, BClass, ...)"), ): next( MultiGet(None, Get(AClass, BClass()), None, None).__await__() # type: ignore[call-overload] )
def test_homogenous(count) -> None: gets = tuple(Get(AClass, BClass()) for _ in range(count)) assert gets == next(MultiGet(*gets).__await__())