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