2018-12-29 18:13:04 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2019-12-31 23:14:23 +00:00
|
|
|
# Copyright 2009-2020 Joshua Bronson. All Rights Reserved.
|
2018-12-29 18:13:04 +00:00
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
"""Set up hypothesis."""
|
|
|
|
|
|
|
|
from os import getenv
|
|
|
|
from hypothesis import HealthCheck, settings, unlimited
|
|
|
|
|
|
|
|
|
|
|
|
MAX_EXAMPLES_DEFAULT = 200
|
2019-09-15 18:19:00 +00:00
|
|
|
SETTINGS = {
|
2018-12-29 18:13:04 +00:00
|
|
|
'max_examples': int(getenv('HYPOTHESIS_MAX_EXAMPLES') or MAX_EXAMPLES_DEFAULT),
|
|
|
|
'deadline': None,
|
|
|
|
'timeout': unlimited,
|
2019-09-15 18:19:00 +00:00
|
|
|
'suppress_health_check': (HealthCheck.too_slow,),
|
2018-12-29 18:13:04 +00:00
|
|
|
}
|
2019-09-15 18:19:00 +00:00
|
|
|
settings.register_profile('custom', **SETTINGS)
|
|
|
|
settings.load_profile('custom')
|