本文整理汇总了Python中hypothesis.settings.Settings.get_profile方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.get_profile方法的具体用法?Python Settings.get_profile怎么用?Python Settings.get_profile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hypothesis.settings.Settings
的用法示例。
在下文中一共展示了Settings.get_profile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_define_setting_then_loading_profile
# 需要导入模块: from hypothesis.settings import Settings [as 别名]
# 或者: from hypothesis.settings.Settings import get_profile [as 别名]
def test_define_setting_then_loading_profile():
x = Settings()
Settings.define_setting(
u'fun_times',
default=3, description=u'Something something spoon',
options=(1, 2, 3, 4),
)
Settings.register_profile('hi', Settings(fun_times=2))
assert x.fun_times == 3
assert Settings.get_profile('hi').fun_times == 2
示例2: test_load_non_existent_profile
# 需要导入模块: from hypothesis.settings import Settings [as 别名]
# 或者: from hypothesis.settings.Settings import get_profile [as 别名]
def test_load_non_existent_profile():
with pytest.raises(hypothesis.errors.InvalidArgument):
Settings.get_profile('nonsense')
示例3: test_has_docstrings
# 需要导入模块: from hypothesis.settings import Settings [as 别名]
# 或者: from hypothesis.settings.Settings import get_profile [as 别名]
import os
import pytest
import hypothesis
from hypothesis.errors import InvalidArgument
from hypothesis.database import ExampleDatabase
from hypothesis.settings import Settings, Verbosity
def test_has_docstrings():
assert Settings.verbosity.__doc__
original_default = Settings.get_profile('default').max_examples
def setup_function(fn):
Settings.load_profile('default')
Settings.register_profile('test_settings', Settings())
Settings.load_profile('test_settings')
def test_cannot_set_non_settings():
s = Settings()
with pytest.raises(AttributeError):
s.databas_file = u'some_file'
def test_settings_uses_defaults():