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

Hypothesis function scoped fixture error #3

Open
raghavio opened this issue Aug 17, 2021 · 0 comments
Open

Hypothesis function scoped fixture error #3

raghavio opened this issue Aug 17, 2021 · 0 comments
Assignees

Comments

@raghavio
Copy link

test_user3 test is failing because it uses the Hypothesis given which can't be used with function scoped fixtures.
Error:

FAILED src/test/test_current.py::test_user3 - hypothesis.errors.FailedHealthCheck: src/test/test_current.py::test_user3 uses the 'session' fixture, which is reset between function calls but not between test cases generated by `@given(...)`.  You can change it to a module- or session-scoped fixture if it is safe to reuse; if not we recommend using a context manager inside your test function.

Switching to an older version should help:
https://hypothesis.readthedocs.io/en/latest/changes.html#hypothesis-5-x

Info on why it's not working:
https://hypothesis.works/articles/hypothesis-pytest-fixtures/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants