GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — gh-107862: Add roundtrip `hypothesis` tests to `test_binascii` by sobolevn · Pull Request #107863 · python/cpython Conversation
|
|
Closing and re-opening to retrigger CLA checks. Sorry for the noise. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @hypothesis.given(binary=hypothesis.strategies.binary()) | ||
| def test_hex_roundtrip(self, binary): | ||
| converted = binascii.hexlify(self.type2test(binary)) | ||
| restored = binascii.unhexlify(self.type2test(converted)) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Wonder if unhexlify should also take a sep and bytes_per_sep argument
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Btw, @rhettinger was against doing this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I agree that we shouldn't rely on Hypothesis' strategies as a substitute for fixed tests. But I think the implementation chosen for adding property based tests in CPython is quite sensible! None of the Hypothesis strategies run by default in our test suite. Hypothesis is stubbed out and simply used used as a DSL to write property based tests where For this specific PR, I guess maybe I should have asked Nikita to add some specific (I also obviously agree we shouldn't use Hypothesis to write tests to enforce properties that are not actually properties, like the colorsys example) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.