Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kiendang committed Oct 24, 2023
1 parent 85905cb commit 86c6077
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/syft/tests/syft/types/dicttuple_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def constructor_args(self, mapping: bool = True) -> list[Callable[[], tuple]]:
def generate(self) -> Generator[DictTuple[_KT, _VT], Any, None]:
return (DictTuple(*args()) for args in self.constructor_args())

def generate_one(self) -> DictTuple:
def generate_one(self) -> DictTuple[_KT, _VT]:
return next(self.generate())

@classmethod
Expand Down Expand Up @@ -179,19 +179,19 @@ def test_all_equal(args1: Callable[[], tuple], args2: Callable[[], tuple]) -> No

@pytest.mark.parametrize(
"dict_tuple,case",
((c.generate_one(), c) for c in TEST_CASES),
[(c.generate_one(), c) for c in TEST_CASES],
)
class TestDictTupleProperties:
def test_should_iter_over_value(self, dict_tuple: DictTuple, case: Case):
def test_should_iter_over_value(self, dict_tuple: DictTuple, case: Case) -> None:
itered = (v for v in dict_tuple)
assert all(a == b for a, b in zip(itered, case.values))

def test_int_indexing(self, dict_tuple: DictTuple, case: Case):
for i in len(dict_tuple):
assert dict_tuple[i] == case.keys[i]
def test_int_indexing(self, dict_tuple: DictTuple, case: Case) -> None:
for i in range(len(dict_tuple)):
assert dict_tuple[i] == case.values[i]

def test_key_indexing(self, dict_tuple: DictTuple, case: Case) -> None:
for k in case.keys():
for k in case.keys:
assert dict_tuple[k] == case.mapping[k]

def test_convert_to_other_iterable_types(
Expand All @@ -201,7 +201,7 @@ def test_convert_to_other_iterable_types(
assert tuple(dict_tuple) == tuple(case.values)

def test_keys(self, dict_tuple: DictTuple, case: Case) -> None:
assert list(dict_tuple.keys()) == list(case.keys())
assert list(dict_tuple.keys()) == list(case.keys)

def test_get_mapping(self, dict_tuple: DictTuple, case: Case) -> None:
assert dict(dict_tuple.items()) == dict(case.mapping)
Expand Down

0 comments on commit 86c6077

Please sign in to comment.