本文整理汇总了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")