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


Python HealthCheck.too_slow方法代码示例

本文整理汇总了Python中hypothesis.HealthCheck.too_slow方法的典型用法代码示例。如果您正苦于以下问题:Python HealthCheck.too_slow方法的具体用法?Python HealthCheck.too_slow怎么用?Python HealthCheck.too_slow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hypothesis.HealthCheck的用法示例。


在下文中一共展示了HealthCheck.too_slow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_valid_headers

# 需要导入模块: from hypothesis import HealthCheck [as 别名]
# 或者: from hypothesis.HealthCheck import too_slow [as 别名]
def test_valid_headers(base_url, swagger_20, definition):
    endpoint = Endpoint(
        "/api/success",
        "GET",
        definition=EndpointDefinition({}, {}, "foo"),
        schema=swagger_20,
        base_url=base_url,
        headers={
            "properties": {"api_key": definition},
            "additionalProperties": False,
            "type": "object",
            "required": ["api_key"],
        },
    )

    @given(case=get_case_strategy(endpoint))
    @settings(suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.too_slow], deadline=None, max_examples=10)
    def inner(case):
        case.call()

    inner() 
开发者ID:kiwicom,项目名称:schemathesis,代码行数:23,代码来源:test_hypothesis.py

示例2: test_hypothesis_parameters

# 需要导入模块: from hypothesis import HealthCheck [as 别名]
# 或者: from hypothesis.HealthCheck import too_slow [as 别名]
def test_hypothesis_parameters(cli, schema_url):
    # When Hypothesis options are passed via command line
    result = cli.run(
        schema_url,
        "--hypothesis-deadline=1000",
        "--hypothesis-derandomize",
        "--hypothesis-max-examples=1000",
        "--hypothesis-phases=explicit,generate",
        "--hypothesis-report-multiple-bugs=0",
        "--hypothesis-suppress-health-check=too_slow,filter_too_much",
        "--hypothesis-verbosity=normal",
    )
    # Then they should be correctly converted into arguments accepted by `hypothesis.settings`
    # Parameters are validated in `hypothesis.settings`
    assert result.exit_code == ExitCode.OK, result.stdout 
开发者ID:kiwicom,项目名称:schemathesis,代码行数:17,代码来源:test_commands.py

示例3: local_do_test

# 需要导入模块: from hypothesis import HealthCheck [as 别名]
# 或者: from hypothesis.HealthCheck import too_slow [as 别名]
def local_do_test( m, data ):
  closed_loop_component_test( m, data )

# Use @given(st.data()) to draw input vector inside the test function
#  - also note that data should the rightmost argument of the test function
# Set deadline to None to avoid checking how long each test spin is
# Set max_examples to limit the number of attempts after multiple successes
# Suppress `too_slow` healthcheck to avoid marking a long test as failed 
开发者ID:pymtl,项目名称:pymtl3,代码行数:10,代码来源:TranslationImport_closed_loop_component_test.py

示例4: pytest_configure

# 需要导入模块: from hypothesis import HealthCheck [as 别名]
# 或者: from hypothesis.HealthCheck import too_slow [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") 
开发者ID:python-attrs,项目名称:attrs,代码行数:8,代码来源:conftest.py


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