Set up hypothesis profiles in dev/ci environments
This commit is contained in:
parent
8d0730bf70
commit
61c81e05b6
@ -1,4 +1,7 @@
|
|||||||
|
from hypothesis import settings
|
||||||
|
|
||||||
from .base import * # noqa: F403
|
from .base import * # noqa: F403
|
||||||
|
from .hypothesis import configure_hypothesis_profiles
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
|
||||||
@ -31,3 +34,5 @@ DATABASES = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
configure_hypothesis_profiles()
|
||||||
|
settings.load_profile("ci")
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from hypothesis import settings
|
||||||
|
|
||||||
from .base import * # noqa: F403
|
from .base import * # noqa: F403
|
||||||
|
from .hypothesis import configure_hypothesis_profiles
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
|
# 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
|
INSTALLED_APPS.append("django_extensions") # noqa: F405
|
||||||
|
|
||||||
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware") # noqa: F405
|
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware") # noqa: F405
|
||||||
|
|
||||||
|
configure_hypothesis_profiles()
|
||||||
|
settings.load_profile(os.getenv("HYPOTHESIS_PROFILE", "dev"))
|
||||||
|
7
cmsmanage/settings/hypothesis.py
Normal file
7
cmsmanage/settings/hypothesis.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user