Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For exercising Patchwork with random inputs.
Implementation notes:
I don't know if the code involving threading is correct.
Leave many TODOs, because doing them would good, but isn't crucial for
the random test to be useful.
Some identifiers have a trailing underscore (hypothesis_) in order to
avoid shadowing global variables.
One might think that starting a thread for every act() is slow, but on
my machine, which is old, it increases the running time of the random
test by only a few seconds (7 s → 8-12 s).
Someone in https://stackoverflow.com/questions/2829329/ advises to
catch BaseException (instead of Exception) and re-raise in
(Terminable)Thread.join. Don't do that, because a SystemExit in a
child thread shouldn't terminate the parent, in my opinion.
Custom exception types are good. Cf.
https://www.youtube.com/watch?v=wf-BqAjZb8M.