Paul Ganssle <[email protected]> added the comment:
I do not want to dissuade you from figuring out how minithesis / hypothesis
works (far from it), but I'm wondering if the question of how shrinking works
is germane to the issue at hand, which is whether or not hypothesis /
property-based-testing is suitable for testing the standard library.
I almost don't think it matters *if* shrinking works, much less *how*.
Shrinking is something of a UI nicety in the sense that when hypothesis finds
an example that violates a property, it will try to take whatever example it
has chosen and find something like a "minimal working example" to show to the
end user. So if we have something like:
```
@given(x=strategies.integers())
def f(x):
assert x >= 0
```
Hypothesis will presumably tell us that `x == -1` will violate the property
instead of `-24948929` or some other random thing. But if it did report
`-24948929` or something, it wouldn't be too hard to see "oh, right, integers
can be negative". In some cases with the time zone stuff, there isn't a good
metric for complexity at the moment, so time zones are sorted by their IANA key
(which is to say, basically arbitrary), and I generally find it useful anyway
(admittedly, the shrinking still is helpful because most problems affecting all
zones will return Africa/Abuja, whereas things particular to a specific zone's
odd time zone history will return whichever zone with that quirk comes
alphabetically first).
Anyway, do not let me disrupt your process, I just thought it might be worth
making the point that some of these specific details might be nice to know, but
don't seem like they should be blockers for hypothesis' adoption in the
standard library.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42109>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com