Skip to content

Hypothesis function scoped fixture error #3

@raghavio

Description

@raghavio

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/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions