Ejemplo n.º 1
0
def test_includes_name_in_repr_if_set():
    assert (
        repr(Integer(10, lambda x: True, name="hi there", random=Random(0)))
        == "Integer('hi there', initial=10, current=10)"
    )
Ejemplo n.º 2
0
def test_normally_contains_no_space_for_name():
    assert (
        repr(Integer(10, lambda x: True, random=Random(0)))
        == "Integer(initial=10, current=10)"
    )
Ejemplo n.º 3
0
def test_debug_output():
    with capture_out() as o:
        Integer.shrink(10, lambda x: True, debug=True, random=Random(0))

    assert "initial=10" in o.getvalue()
    assert "shrinking to 0" in o.getvalue()
def test_normally_contains_no_space_for_name():
    assert repr(
        Integer(10, lambda x: True)) == 'Integer(initial=10, current=10)'
def test_includes_name_in_repr_if_set():
    assert repr(
        Integer(10, lambda x: True, name='hi there')
    ) == "Integer('hi there', initial=10, current=10)"
def test_debug_output():
    with capture_out() as o:
        Integer.shrink(10, lambda x: True, debug=True)

    assert 'initial=10' in o.getvalue()
    assert 'shrinking to 0' in o.getvalue()
def test_debug_output():
    with capture_out() as o:
        Integer.shrink(10, lambda x: True, debug=True, random=Random(0))

    assert "initial=10" in o.getvalue()
    assert "shrinking to 0" in o.getvalue()