Set up hypothesis profiles in dev/ci environments
All checks were successful
Ruff / ruff (push) Successful in 25s
Test / test (push) Successful in 5m20s

This commit is contained in:
Adam Goldsmith 2024-02-19 16:22:39 -05:00
parent 8d0730bf70
commit 61c81e05b6
3 changed files with 20 additions and 0 deletions

View File

@ -1,4 +1,7 @@
from hypothesis import settings
from .base import * # noqa: F403
from .hypothesis import configure_hypothesis_profiles
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
@ -31,3 +34,5 @@ DATABASES = {
},
},
}
configure_hypothesis_profiles()
settings.load_profile("ci")

View File

@ -1,4 +1,9 @@
import os
from hypothesis import settings
from .base import * # noqa: F403
from .hypothesis import configure_hypothesis_profiles
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
@ -13,3 +18,6 @@ INSTALLED_APPS.append("debug_toolbar") # noqa: F405
INSTALLED_APPS.append("django_extensions") # noqa: F405
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware") # noqa: F405
configure_hypothesis_profiles()
settings.load_profile(os.getenv("HYPOTHESIS_PROFILE", "dev"))

View File

@ -0,0 +1,7 @@
from hypothesis import HealthCheck, Verbosity, settings
def configure_hypothesis_profiles():
settings.register_profile("ci", suppress_health_check=(HealthCheck.too_slow,))
settings.register_profile("dev", max_examples=20)
settings.register_profile("debug", max_examples=10, verbosity=Verbosity.verbose)