open-contracting/cove-ocds

Hypothesis: Un-suppress health check

Closed this issue · 0 comments

I made this commit to avoid a warning: dc4317e

The warning was:

hypothesis.errors.FailedHealthCheck: cove_ocds/test_hypothesis.py::test_explore_page_duplicate_ids[cove-ocds] uses the 'client' 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. See https://docs.pytest.org/en/latest/fixture.html#sharing-test-data for details on fixture scope.

See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.function_scoped_fixture to the suppress_health_check settings for this test.

I don't think we can change the scope of the client fixture provided by pytest-django, and I'm not sure what is suggested to be used as a context manager.