Пример #1
0
def test_factorial3(n):
    with pytest.raises(TypeError):
        factorial(n)
Пример #2
0
def test_factorial1():
    vals = [0, 1, 2, 3, 4, 5]
    facs = [1, 1, 2, 6, 24, 120]
    for v, f in zip(vals, facs):
        assert_equal(factorial(v), f)
Пример #3
0
def test_factorial2(n):
    with pytest.raises(ValueError):
        factorial(n)
Пример #4
0
def test_factorial1(n, expected):
    assert factorial(n) == expected
Пример #5
0
def test_factorial3(n):
    with pytest.raises(TypeError):
        factorial(n)
Пример #6
0
def test_factorial2(n):
    with pytest.raises(ValueError):
        factorial(n)
Пример #7
0
def test_factorial1(n, expected):
    assert factorial(n) == expected