Skip to content

Commit

Permalink
fix random tests for older versions of python
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Nov 16, 2024
1 parent 1f037d9 commit 9ec7823
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ def add_spaces(content, targets):
return re.sub(f'[{re.escape(targets)}]', pad_randomly, content).lstrip(' ')


@settings(max_examples=max_examples)
@given(st.from_type(bool | None | int | float))
def test_types(v):
expected = None if v is None else str(v)
assert nt.loads(nt.dumps(v), top=any) == expected
if sys.version_info[:3] > (3,10):
@settings(max_examples=max_examples)
@given(st.from_type(bool | None | int | float))
def test_types(v):
expected = None if v is None else str(v)
assert nt.loads(nt.dumps(v), top=any) == expected

@settings(max_examples=max_examples)
@given(st.text())
Expand Down

0 comments on commit 9ec7823

Please sign in to comment.