Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error with very large ints in to_jsonable #3876

Merged
merged 3 commits into from
Feb 8, 2024

Conversation

tybug
Copy link
Member

@tybug tybug commented Feb 8, 2024

Noticed when investigating #3874.

Can reproduce with:

@given(st.integers(0, 1<<10000))
def test_f(n):
    pass
test_f()
...
  File "/Users/tybug/Desktop/Liam/coding/hypothesis/hypothesis-python/src/hypothesis/strategies/_internal/utils.py", line 163, in to_jsonable
    return float(obj)
           ^^^^^^^^^^
OverflowError: int too large to convert to float

@tybug tybug requested a review from Zac-HD as a code owner February 8, 2024 02:36
@tybug
Copy link
Member Author

tybug commented Feb 8, 2024

saw a coverage flake, so tried increasing the reliability in 6c42078. 5 should have been plenty, but increasing iterations is cheap and I don't particularly want to rabbit-hole into it right now.

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Zac-HD Zac-HD merged commit cd8e71f into HypothesisWorks:master Feb 8, 2024
48 checks passed
@tybug tybug deleted the fix-float-oob branch February 8, 2024 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants