diff --git a/swh/web/tests/conftest.py b/swh/web/tests/conftest.py --- a/swh/web/tests/conftest.py +++ b/swh/web/tests/conftest.py @@ -10,7 +10,9 @@ import sys from typing import Any, Dict, List, Optional -from hypothesis import HealthCheck, settings +from hypothesis import HealthCheck +from hypothesis import __version_info__ as hypothesis_version +from hypothesis import settings import pytest from django.core.cache import cache @@ -34,20 +36,18 @@ # Register some hypothesis profiles settings.register_profile("default", settings()) +suppress_health_check = [HealthCheck.too_slow, HealthCheck.filter_too_much] +if hypothesis_version >= (5, 49): + suppress_health_check.append(HealthCheck.function_scoped_fixture) + settings.register_profile( - "swh-web", - settings( - deadline=None, - suppress_health_check=[HealthCheck.too_slow, HealthCheck.filter_too_much], - ), + "swh-web", settings(deadline=None, suppress_health_check=suppress_health_check,), ) settings.register_profile( "swh-web-fast", settings( - deadline=None, - max_examples=1, - suppress_health_check=[HealthCheck.too_slow, HealthCheck.filter_too_much], + deadline=None, max_examples=1, suppress_health_check=suppress_health_check, ), )