Python hypothesis.HealthCheck.too_slow() Examples

The following are 4 code examples of hypothesis.HealthCheck.too_slow(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module hypothesis.HealthCheck , or try the search function .
Example #1
Source File: test_hypothesis.py    From schemathesis with MIT License 7 votes vote down vote up
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() 
Example #2
Source File: test_commands.py    From schemathesis with MIT License 5 votes vote down vote up
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 
Example #3
Source File: TranslationImport_closed_loop_component_test.py    From pymtl3 with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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 
Example #4
Source File: conftest.py    From attrs with MIT License 5 votes vote down vote up
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")