Add test for non-integer input to factorial function (#13024)
Some checks failed
directory_writer / directory_writer (push) Has been cancelled
ruff / ruff (push) Has been cancelled
sphinx / build_docs (push) Has been cancelled
sphinx / deploy_docs (push) Has been cancelled
Project Euler / project-euler (push) Has been cancelled
Project Euler / validate-solutions (push) Has been cancelled
build / build (push) Has been cancelled
Some checks failed
directory_writer / directory_writer (push) Has been cancelled
ruff / ruff (push) Has been cancelled
sphinx / build_docs (push) Has been cancelled
sphinx / deploy_docs (push) Has been cancelled
Project Euler / project-euler (push) Has been cancelled
Project Euler / validate-solutions (push) Has been cancelled
build / build (push) Has been cancelled
* 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