Esempio n. 1
0
def test_linearroots():
    assert rt.linear_roots(5, 10) == -2
Esempio n. 2
0
def test_linear_zeroceoff():
    try:
        rt.linear_roots(a=0)
    except ValueError as err:
        assert (sys.exc_info()[0] == ValueError)
Esempio n. 3
0
def test_linearroots_types():
    with pytest.raises(TypeError):
        roots.linear_roots("ocean", 6.0)
Esempio n. 4
0
def test_linearroots_zerocoeff():
    with pytest.raises(ValueError):
        roots.linear_roots(a=0.0)
Esempio n. 5
0
def test_linearroots_zerocoeff():
    try:
        roots.linear_roots(a=0.0)
    except ValueError as err:
        assert(type(err) == ValueError)
Esempio n. 6
0
def test_linearoots_result():
    assert roots.linear_roots(2.0, -3.0) == 1.5
Esempio n. 7
0
def test_linearroots_types():
    try:
        roots.linear_roots("ocean", 6.0)
    except TypeError as err:
        assert(type(err) == TypeError)
Esempio n. 8
0
def test_linroots_types():
    with pytest.raises(TypeError):
        roots.linear_roots("o", 9.0)
Esempio n. 9
0
def test_linroots_result():
    assert roots.linear_roots(6.0, -12.0) == 2
Esempio n. 10
0
def test_linearroots_types():
    with pytest.raises(TypeError):
        roots.linear_roots("", "green", "hi")
Esempio n. 11
0
def test_linearroots_result():
    assert roots.linear_roots(1.0, 2.0) == -2.0