mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-12-19 02:07:27 +08:00
Add test for non-integer input to factorial function (#13024)
* Add test for non-integer input to factorial function * Update test_factorial.py --------- Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
This commit is contained in:
@@ -33,5 +33,11 @@ def test_negative_number(function):
|
||||
function(-3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("function", [factorial, factorial_recursive])
|
||||
def test_float_number(function):
|
||||
with pytest.raises(ValueError):
|
||||
function(1.5)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pytest.main(["-v", __file__])
|
||||
|
||||
Reference in New Issue
Block a user