Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite2a78d4

Browse files
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>
1 parent1b0bd16 commite2a78d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎maths/test_factorial.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,11 @@ def test_negative_number(function):
3333
function(-3)
3434

3535

36+
@pytest.mark.parametrize("function", [factorial,factorial_recursive])
37+
deftest_float_number(function):
38+
withpytest.raises(ValueError):
39+
function(1.5)
40+
41+
3642
if__name__=="__main__":
3743
pytest.main(["-v",__file__])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp