Skip to content

Commit 1c59fa3

Browse files
committed
Test the exception raising logic for non-ints
1 parent 340beaa commit 1c59fa3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/tests/test_flip_coins_function.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ def test_multiple_coin_flips(coin_flip_count: int) -> None:
2828
assert coin_flip_result["outcome"][0] in ["won", "lost", "tie"]
2929

3030

31+
def test_multiple_coin_flip_invalid_input_type() -> None:
32+
"""Test the exception handling of flip_coins when given an invalid input type"""
33+
with pytest.raises(TypeError):
34+
src.flip_coins.flip_coins(
35+
coin_flip_count="twenty",
36+
chosen_side="tails",
37+
)
38+
39+
3140
def test_multiple_coin_flip_zero_times() -> None:
3241
"""Test the exception handling of flip_coins when asked to flip 0 coins"""
3342
with pytest.raises(ValueError):

0 commit comments

Comments
 (0)