本文整理汇总了Python中hypothesis.settings.Settings.load_profile方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.load_profile方法的具体用法?Python Settings.load_profile怎么用?Python Settings.load_profile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hypothesis.settings.Settings
的用法示例。
在下文中一共展示了Settings.load_profile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_loading_profile_keeps_expected_behaviour
# 需要导入模块: from hypothesis.settings import Settings [as 别名]
# 或者: from hypothesis.settings.Settings import load_profile [as 别名]
def test_loading_profile_keeps_expected_behaviour():
Settings.register_profile('ci', Settings(max_examples=10000))
Settings.load_profile('ci')
assert Settings().max_examples == 10000
with Settings(max_examples=5):
assert Settings().max_examples == 5
assert Settings().max_examples == 10000
示例2: test_load_profile
# 需要导入模块: from hypothesis.settings import Settings [as 别名]
# 或者: from hypothesis.settings.Settings import load_profile [as 别名]
def test_load_profile():
Settings.load_profile('default')
assert Settings.default.max_examples == 200
assert Settings.default.max_shrinks == 500
assert Settings.default.min_satisfying_examples == 5
Settings.register_profile(
'test',
Settings(
max_examples=10,
max_shrinks=5
)
)
Settings.load_profile('test')
assert Settings.default.max_examples == 10
assert Settings.default.max_shrinks == 5
assert Settings.default.min_satisfying_examples == 5
Settings.load_profile('default')
assert Settings.default.max_examples == 200
assert Settings.default.max_shrinks == 500
assert Settings.default.min_satisfying_examples == 5
示例3: test_modifying_registered_profile_does_not_change_profile
# 需要导入模块: from hypothesis.settings import Settings [as 别名]
# 或者: from hypothesis.settings.Settings import load_profile [as 别名]
def test_modifying_registered_profile_does_not_change_profile():
ci_profile = Settings(max_examples=10000)
Settings.register_profile('ci', ci_profile)
ci_profile.max_examples = 1
Settings.load_profile('ci')
assert Settings().max_examples == 10000
示例4: test_loading_profile_resets_defaults
# 需要导入模块: from hypothesis.settings import Settings [as 别名]
# 或者: from hypothesis.settings.Settings import load_profile [as 别名]
def test_loading_profile_resets_defaults():
assert Settings.default.min_satisfying_examples == 5
Settings.default.min_satisfying_examples = 100
assert Settings.default.min_satisfying_examples == 100
Settings.load_profile('default')
assert Settings.default.min_satisfying_examples == 5
示例5: setup_function
# 需要导入模块: from hypothesis.settings import Settings [as 别名]
# 或者: from hypothesis.settings.Settings import load_profile [as 别名]
def setup_function(fn):
Settings.load_profile('default')
Settings.register_profile('test_settings', Settings())
Settings.load_profile('test_settings')