当前位置: 首页>>代码示例>>Python>>正文


Python Settings.load_profile方法代码示例

本文整理汇总了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
开发者ID:Bachmann1234,项目名称:hypothesis,代码行数:9,代码来源:test_settings.py

示例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
开发者ID:Bachmann1234,项目名称:hypothesis,代码行数:27,代码来源:test_settings.py

示例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
开发者ID:Bachmann1234,项目名称:hypothesis,代码行数:8,代码来源:test_settings.py

示例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
开发者ID:Bachmann1234,项目名称:hypothesis,代码行数:8,代码来源:test_settings.py

示例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')
开发者ID:GMadorell,项目名称:hypothesis,代码行数:6,代码来源:test_settings.py


注:本文中的hypothesis.settings.Settings.load_profile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。