Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a helpful error if @example() is passed a strategy #2611

Closed
Zac-HD opened this issue Sep 8, 2020 · 0 comments
Closed

Add a helpful error if @example() is passed a strategy #2611

Zac-HD opened this issue Sep 8, 2020 · 0 comments
Labels
legibility make errors helpful and Hypothesis grokable

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Sep 8, 2020

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.

@Zac-HD Zac-HD added the legibility make errors helpful and Hypothesis grokable label Sep 8, 2020
@Zac-HD Zac-HD closed this as completed Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legibility make errors helpful and Hypothesis grokable
Projects
None yet
Development

No branches or pull requests

1 participant