當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。