In which the author dives very deep (far deeper than called for) into using Hypothesis to generate data for #Python tests:
https://nedbatchelder.com/blog/202512/generating_data_shapes_with_hypothesis.html
In which the author dives very deep (far deeper than called for) into using Hypothesis to generate data for #Python tests:
https://nedbatchelder.com/blog/202512/generating_data_shapes_with_hypothesis.html
If you have a fediverse account, you can quote this note from your own instance. Search https://hachyderm.io/users/nedbat/statuses/115758611283655705 on your instance and quote it. (Note that quoting is not supported in Mastodon.)
RE: https://hachyderm.io/@nedbat/115758611283655705
I also got to use this Python oddity for real in a test suite:
https://github.com/coveragepy/coveragepy/blob/main/tests/test_misc.py#L24-L30
# Make two sets which are equal but iterate differently.
numset1 = set(range(20))
numset2 = set(range(20))
for i in range(0, 20, 2):
numset2.remove(i)
for i in range(0, 20, 2):
numset2.add(i)
def test_scrambled_sets():
assert numset1 == numset2
assert list(numset1) != list(numset2)