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

Add hypothesis tests and bounds checks on Integers #1

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

CharString
Copy link
Contributor

These are the kind of tests I meant during the Deep Dive stream.

Writing them they let me discover there were no bounds checks.
I leave it as an exercise to the reader to add the round trip tests for signed integers and other bit-sized unsigned integers.

I haven't gotten to the more interesting cases: the nested structures. Hypothesis can be used to create arbitrary nested structures for these.

@tannewt
Copy link
Member

tannewt commented Jul 18, 2024

Ah! Thank you! Want to run ruff via pre-commit or should I?

@CharString
Copy link
Contributor Author

CharString commented Jul 18, 2024 via email

@CharString
Copy link
Contributor Author

CharString commented Jul 18, 2024

@tannewt There you go. I've change the CI job to install the test dependencies enumerated in the pyproject.toml.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit e590447 into adafruit:main Jul 18, 2024
3 checks passed
@CharString CharString deleted the add-hypothesis-tests branch July 18, 2024 19:54
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.

2 participants