Beispiel #1
0
def test_factorial_num():
    assert factorial_num(0) == 1
    assert factorial_num(1) == 1
    assert factorial_num(5) == 120
    assert factorial_num(
        50
    ) == 30414093201713378043612608166064768844377641568960512000000000000
Beispiel #2
0
def test_invalid_factorial_3():
    with pytest.raises(ValueError):
        factorial_num(-1)
Beispiel #3
0
def test_invalid_factorial_4():
    with pytest.raises(TypeError):
        factorial_num(-5.0)
Beispiel #4
0
def test_invalid_factorial_1():
    with pytest.raises(TypeError):
        factorial_num('k')