Exemple #1
0
def test_loading_profile_keeps_expected_behaviour():
    settings.register_profile('ci', settings(max_examples=10000))
    settings.load_profile('ci')
    assert settings().max_examples == 10000
    with settings(max_examples=5):
        assert settings().max_examples == 5
    assert settings().max_examples == 10000
def test_loading_profile_keeps_expected_behaviour():
    settings.register_profile('ci', settings(max_examples=10000))
    settings.load_profile('ci')
    assert settings().max_examples == 10000
    with settings(max_examples=5):
        assert settings().max_examples == 5
    assert settings().max_examples == 10000
def test_loading_profile_keeps_expected_behaviour():
    settings.register_profile("ci", settings(max_examples=10000))
    settings.load_profile("ci")
    assert settings().max_examples == 10000
    with local_settings(settings(max_examples=5)):
        assert settings().max_examples == 5
    assert settings().max_examples == 10000
def test_profile_names_must_be_strings():
    with pytest.raises(InvalidArgument):
        settings.register_profile(5)
    with pytest.raises(InvalidArgument):
        settings.get_profile(5)
    with pytest.raises(InvalidArgument):
        settings.load_profile(5)
Exemple #5
0
def test_loading_profile_keeps_expected_behaviour():
    settings.register_profile("ci", settings(max_examples=10000))
    settings.load_profile("ci")
    assert settings().max_examples == 10000
    with local_settings(settings(max_examples=5)):
        assert settings().max_examples == 5
    assert settings().max_examples == 10000
Exemple #6
0
def test_profile_names_must_be_strings():
    with pytest.raises(InvalidArgument):
        settings.register_profile(5)
    with pytest.raises(InvalidArgument):
        settings.get_profile(5)
    with pytest.raises(InvalidArgument):
        settings.load_profile(5)
def test_load_profile():
    settings.load_profile('default')
    assert settings.default.max_examples == 200
    assert settings.default.max_shrinks == 500
    assert settings.default.min_satisfying_examples == 5

    settings.register_profile(
        'test',
        settings(
            max_examples=10,
            max_shrinks=5
        )
    )

    settings.load_profile('test')

    assert settings.default.max_examples == 10
    assert settings.default.max_shrinks == 5
    assert settings.default.min_satisfying_examples == 5

    settings.load_profile('default')

    assert settings.default.max_examples == 200
    assert settings.default.max_shrinks == 500
    assert settings.default.min_satisfying_examples == 5
def test_load_profile():
    settings.load_profile('default')
    assert settings.default.max_examples == 100
    assert settings.default.max_shrinks == 500

    settings.register_profile('test', settings(max_examples=10), max_shrinks=5)
    settings.load_profile('test')

    assert settings.default.max_examples == 10
    assert settings.default.max_shrinks == 5

    settings.load_profile('default')

    assert settings.default.max_examples == 100
    assert settings.default.max_shrinks == 500
def test_load_profile():
    settings.load_profile("default")
    assert settings.default.max_examples == original_default
    assert settings.default.stateful_step_count == 50

    settings.register_profile("test", settings(max_examples=10), stateful_step_count=5)
    settings.load_profile("test")

    assert settings.default.max_examples == 10
    assert settings.default.stateful_step_count == 5

    settings.load_profile("default")

    assert settings.default.max_examples == original_default
    assert settings.default.stateful_step_count == 50
def test_load_profile():
    settings.load_profile("default")
    assert settings.default.max_examples == original_default
    assert settings.default.stateful_step_count == 50

    settings.register_profile("test", settings(max_examples=10), stateful_step_count=5)
    settings.load_profile("test")

    assert settings.default.max_examples == 10
    assert settings.default.stateful_step_count == 5

    settings.load_profile("default")

    assert settings.default.max_examples == original_default
    assert settings.default.stateful_step_count == 50
Exemple #11
0
def test_load_profile():
    settings.load_profile('default')
    assert settings.default.max_examples == 100
    assert settings.default.stateful_step_count == 50

    settings.register_profile('test',
                              settings(max_examples=10),
                              stateful_step_count=5)
    settings.load_profile('test')

    assert settings.default.max_examples == 10
    assert settings.default.stateful_step_count == 5

    settings.load_profile('default')

    assert settings.default.max_examples == 100
    assert settings.default.stateful_step_count == 50
Exemple #12
0
def test_load_profile():
    settings.load_profile('default')
    assert settings.default.max_examples == 200
    assert settings.default.max_shrinks == 500
    assert settings.default.min_satisfying_examples == 5

    settings.register_profile('test', settings(max_examples=10, max_shrinks=5))

    settings.load_profile('test')

    assert settings.default.max_examples == 10
    assert settings.default.max_shrinks == 5
    assert settings.default.min_satisfying_examples == 5

    settings.load_profile('default')

    assert settings.default.max_examples == 200
    assert settings.default.max_shrinks == 500
    assert settings.default.min_satisfying_examples == 5
def setup_function(fn):
    settings.load_profile("default")
    settings.register_profile("test_settings", settings())
    settings.load_profile("test_settings")
def setup_function(fn):
    settings.load_profile('default')
    settings.register_profile('test_settings', settings())
    settings.load_profile('test_settings')
Exemple #15
0
def test_nonstring_profile_names_deprecated():
    settings.register_profile(5, max_shrinks=5)
    settings.load_profile(5)
    assert settings.default.max_shrinks == 5
Exemple #16
0
def test_nonstring_profile_names_deprecated():
    settings.register_profile(5, stateful_step_count=5)
    settings.load_profile(5)
    assert settings.default.stateful_step_count == 5
Exemple #17
0
def test_register_profile_kwarg_settings_is_deprecated():
    settings.register_profile('test', settings=settings(max_examples=10))
    settings.load_profile('test')
    assert settings.default.max_examples == 10
Exemple #18
0
def setup_function(fn):
    settings.load_profile("default")
    settings.register_profile("test_settings", settings())
    settings.load_profile("test_settings")
def test_nonstring_profile_names_deprecated():
    settings.register_profile(5, stateful_step_count=5)
    settings.load_profile(5)
    assert settings.default.stateful_step_count == 5
Exemple #20
0
def setup_function(fn):
    settings.load_profile('default')
    settings.register_profile('test_settings', settings())
    settings.load_profile('test_settings')
def test_register_profile_kwarg_settings_is_deprecated():
    settings.register_profile('test', settings=settings(max_examples=10))
    settings.load_profile('test')
    assert settings.default.max_examples == 10