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