Add a helpful error if @example() is passed a strategy
#2611
Labels
legibility
make errors helpful and Hypothesis grokable
@example() is passed a strategy
#2611
Passing a strategy to
@example(), as in this StackOverflow question, is probably due to user confusion and usually results in a confusing error message.It would be nice to check if a strategy was passed as an argument when an error is raised, and raise a more specific exception and message if so. So long as we also set the
__cause__, this will have minimal impact even if our guess of the underlying cause is incorrect - and do nothing at all if the test passed.The text was updated successfully, but these errors were encountered: