Esempio n. 1
0
def test_quadroots_zerocoeff():
    try:
        rt.quad_roots(a=0.0)
    except ValueError as err:
        assert (sys.exc_info()[0] == ValueError)
Esempio n. 2
0
def test_quadroots():
    assert rt.quad_roots(1.0, 1.0, -12.0) == ((3 + 0j), (-4 + 0j))
Esempio n. 3
0
def test_quadroots_types():
    with pytest.raises(TypeError):
        roots.quad_roots("", "green", "hi")
Esempio n. 4
0
def test_quadroots_types():
    try:
        rt.quad_roots("", "green", "hi")
    except TypeError as err:
        assert (sys.exc_info()[0] == TypeError)
Esempio n. 5
0
def test_quadroots_zerocoeff():
    with pytest.raises(ValueError):
        roots.quad_roots(a=0.0)
Esempio n. 6
0
def test_quadroots_result():
    assert roots.quad_roots(1.0, 1.0, -12.0) == ((3+0j), (-4+0j))
Esempio n. 7
0
def test_quadroots_types():
    try:
        roots.quad_roots("", "green", "hi")
    except TypeError as err:
        assert(type(err) == TypeError)
Esempio n. 8
0
def test_quadroots_imagresult():
    assert roots.quad_roots(1.0, 0.0, 1.0) == ((0+1j), (0-1j))
Esempio n. 9
0
def test_quadroots_zerocoeff():
    try:
        roots.quad_roots(a=0.0)
    except ValueError as err:
        assert(type(err) == ValueError)
Esempio n. 10
0
def test_quadroots_result():
    # random comment
    assert roots.quad_roots(1.0, 1.0, -12.0) == ((3+0j), (-4+0j))
Esempio n. 11
0
def test_quadroots_types():
    with pytest.raises(TypeError):
        roots.quad_roots("saul", "elephante",
                         ["hi", "correct", "list", "connotation"])