def test_factorial3(n): with pytest.raises(TypeError): factorial(n)
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)
def test_factorial2(n): with pytest.raises(ValueError): factorial(n)
def test_factorial1(n, expected): assert factorial(n) == expected