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