Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Feb 6, 2024
1 parent ef1609d commit 739864b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/v/test_ensure.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def test_ensured_ints(valconv: BaseConverter):

def test_ensured_lists(valconv: BaseConverter):
"""Validation for lists works."""
assert valconv.structure([1, 2], ensure(list[int], lambda lst: len(lst) > 0))
assert valconv.structure([1, 2], ensure(List[int], lambda lst: len(lst) > 0))

with raises(Exception) as exc:
valconv.structure([], ensure(list[int], lambda lst: len(lst) > 0))
valconv.structure([], ensure(List[int], lambda lst: len(lst) > 0))

if valconv.detailed_validation:
assert isinstance(exc.value, ExceptionGroup)
Expand Down Expand Up @@ -63,10 +63,10 @@ def test_ensured_list_elements(valconv: BaseConverter, type):
@mark.skipif(sys.version_info[:2] < (3, 10), reason="Not supported on older Pythons")
def test_ensured_list(valconv: BaseConverter):
"""Ensure works for builtin lists."""
assert valconv.structure([1, 2], ensure(list, elems=ensure(int, lambda i: i > 0)))
assert valconv.structure([1, 2], ensure(List, elems=ensure(int, lambda i: i > 0)))

with raises(Exception) as exc:
valconv.structure([1, -2], ensure(list, elems=ensure(int, lambda i: i > 0)))
valconv.structure([1, -2], ensure(List, elems=ensure(int, lambda i: i > 0)))

if valconv.detailed_validation:
assert isinstance(exc.value, ExceptionGroup)
Expand Down

0 comments on commit 739864b

Please sign in to comment.