本文整理匯總了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()
示例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
示例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
示例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")