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

Tests for binascii #18

Merged
merged 7 commits into from
May 20, 2020
Merged

Conversation

akash-suresh
Copy link
Contributor

I have added tests for the binascii module. Let me know if there are any corrections needed.

Copy link
Owner

@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 work @akash-suresh!

tests/test_encode_decode.py Outdated Show resolved Hide resolved
tests/test_encode_decode.py Outdated Show resolved Hide resolved
tests/test_encode_decode.py Outdated Show resolved Hide resolved
tests/test_encode_decode.py Outdated Show resolved Hide resolved
@Zac-HD
Copy link
Owner

Zac-HD commented May 20, 2020

Cross-reference: HypothesisWorks/hypothesis#2430

@akash-suresh
Copy link
Contributor Author

Hey @Zac-HD! I have made changes, based on the comments.

@Zac-HD
Copy link
Owner

Zac-HD commented May 20, 2020

import binascii
binascii.crc_hqx(b"", 2 ** 63)

fails (only) on PyPy, with OverflowError: int too large to convert to int. I think you've found a bug!

@cfbolz might be able to help us diagnose this?

tests/test_encode_decode.py Outdated Show resolved Hide resolved
@cfbolz
Copy link
Contributor

cfbolz commented May 20, 2020

@Zac-HD nice catch! yes, will look into it!

@cfbolz
Copy link
Contributor

cfbolz commented May 20, 2020

yep, fixed (an unsigned vs signed int issue, also a change from py2->py3). here's the commit: https://foss.heptapod.net/pypy/pypy/commit/7b826e1a27677daa643bfa4535daafecc4526335
Are we keeping a list of found bugs yet? We should add this!

@Zac-HD
Copy link
Owner

Zac-HD commented May 20, 2020

@cfbolz, impressively fast!

We do have https://github.com/Zac-HD/stdlib-property-tests#trophy-case - is there a canonical link to point to for this, or should the new entry just point to this thread and commit link?

@akash-suresh akash-suresh force-pushed the hypothesis-tests-for-binascii branch from 0a15ee8 to 966559d Compare May 20, 2020 12:12
@Zac-HD Zac-HD merged commit 39769fa into Zac-HD:master May 20, 2020
@cfbolz
Copy link
Contributor

cfbolz commented May 20, 2020

@Zac-HD I'd just point to the commit link - we don't track all changes as issues or anything like that.

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.

3 participants