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

* 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:
Md Mahiuddin
2025-10-20 06:59:36 +06:00
committed by GitHub
parent 1b0bd16729
commit e2a78d4e76

View File

@@ -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__])