Skip to content

Commit 97e9f16

Browse files
committed
Add type hints to test functions for improved clarity and consistency
1 parent d8f8e7d commit 97e9f16

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_wzrdbrain.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from wzrdbrain.wzrdbrain import Trick, generate_combo, DIRECTIONS, MOVES, STANCES, only_first
33

44

5-
def test_trick_creation_with_validation():
5+
def test_trick_creation_with_validation() -> None:
66
"""Test that creating a Trick with invalid data raises a ValueError."""
77
with pytest.raises(ValueError, match="Invalid move"):
88
Trick(move="invalid_move")
@@ -12,7 +12,7 @@ def test_trick_creation_with_validation():
1212
Trick(stance="invalid_stance")
1313

1414

15-
def test_trick_default_creation():
15+
def test_trick_default_creation() -> None:
1616
"""Test creating a Trick with no arguments uses random defaults."""
1717
trick = Trick()
1818
assert isinstance(trick, Trick)
@@ -24,7 +24,7 @@ def test_trick_default_creation():
2424
assert trick.stance in STANCES
2525

2626

27-
def test_trick_str_representation():
27+
def test_trick_str_representation() -> None:
2828
"""Test the string formatting of a Trick, including the 'fakie' logic."""
2929
trick1 = Trick(direction="front", stance="open", move="gazelle")
3030
assert str(trick1) == "front open gazelle"
@@ -36,7 +36,7 @@ def test_trick_str_representation():
3636
assert str(trick3) == "forward soul slide"
3737

3838

39-
def test_trick_to_dict():
39+
def test_trick_to_dict() -> None:
4040
"""Test the to_dict method includes the 'name' key."""
4141
trick = Trick(direction="front", stance="open", move="gazelle")
4242
trick_dict = trick.to_dict()
@@ -46,7 +46,7 @@ def test_trick_to_dict():
4646
assert trick_dict["move"] == "gazelle"
4747

4848

49-
def test_generate_combo_returns_list_of_dicts():
49+
def test_generate_combo_returns_list_of_dicts() -> None:
5050
"""Test that generate_combo returns a list of trick dictionaries."""
5151
combo = generate_combo(3)
5252
assert isinstance(combo, list)
@@ -57,7 +57,7 @@ def test_generate_combo_returns_list_of_dicts():
5757
assert "move" in trick_dict
5858

5959

60-
def test_generate_combo_linking():
60+
def test_generate_combo_linking() -> None:
6161
"""Test that tricks in a combo are linked by their exit/enter directions."""
6262
# Generate a long combo to increase the chance of seeing rotation
6363
combo = generate_combo(10)
@@ -67,7 +67,7 @@ def test_generate_combo_linking():
6767
assert current_trick["exit_from_trick"] == next_trick["enter_into_trick"]
6868

6969

70-
def test_generate_combo_only_first_rule():
70+
def test_generate_combo_only_first_rule() -> None:
7171
"""Test that moves in 'only_first' do not appear after the first trick."""
7272
# Run multiple times to ensure rule is consistently applied
7373
for _ in range(10):

0 commit comments

Comments
 (0)