Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow strategy-generating functions to not provide strategies
Custom type strategies registered with register_type_strategy() can now choose not to provide a strategy for a type by returning NotImplemented instead of a strategy. This allows custom strategies to only provide a custom strategies for certain subtypes of a type, or certain generic parameters, while deferring to another strategy for the unhandled cases.
- Loading branch information
Showing
6 changed files
with
194 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
RELEASE_TYPE: minor | ||
|
||
This release allows strategy-generating functions registered with | ||
:func:`~hypothesis.strategies.register_type_strategy` to conditionally not | ||
return a strategy, by returning :data:`NotImplemented` (:issue:`3767`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters