本文整理汇总了Python中hypothesis.settings.load_profile方法的典型用法代码示例。如果您正苦于以下问题:Python settings.load_profile方法的具体用法?Python settings.load_profile怎么用?Python settings.load_profile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hypothesis.settings
的用法示例。
在下文中一共展示了settings.load_profile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _modify_hypothesis_settings
# 需要导入模块: from hypothesis import settings [as 别名]
# 或者: from hypothesis.settings import load_profile [as 别名]
def _modify_hypothesis_settings(settings, name, parent=None):
if parent is None:
parent = hp_settings._current_profile
if "phases" in settings:
try:
settings["phases"] = [getattr(Phase, k) for k, v in settings["phases"].items() if v]
except AttributeError as exc:
raise ValueError(f"'{exc.args[0]}' is not a valid hypothesis phase setting")
hp_settings.register_profile(
name,
parent=hp_settings.get_profile(parent),
database=DirectoryBasedExampleDatabase(_get_data_folder().joinpath("hypothesis")),
**settings,
)
hp_settings.load_profile(name)
示例2: SMTestBase
# 需要导入模块: from hypothesis import settings [as 别名]
# 或者: from hypothesis.settings import load_profile [as 别名]
def SMTestBase(devnetwork):
settings.load_profile("derandomize")
class _Base:
def rule_one(self):
pass
def rule_two(self):
pass
yield _Base
settings.load_profile("default")
示例3: pytest_configure
# 需要导入模块: from hypothesis import settings [as 别名]
# 或者: from hypothesis.settings import load_profile [as 别名]
def pytest_configure(config):
# HealthCheck.too_slow causes more trouble than good -- especially in CIs.
settings.register_profile(
"patience", settings(suppress_health_check=[HealthCheck.too_slow])
)
settings.load_profile("patience")