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


Python Settings.get_profile方法代码示例

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

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

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


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