File tree Expand file tree Collapse file tree 2 files changed +86
-83
lines changed
Expand file tree Collapse file tree 2 files changed +86
-83
lines changed Original file line number Diff line number Diff line change 1+ """BalatroClient-specific test configuration and fixtures."""
2+
3+ import pytest
4+
5+ from balatrobot .client import BalatroClient
6+ from balatrobot .enums import State
7+ from balatrobot .exceptions import BalatroError , ConnectionFailedError
8+ from balatrobot .models import G
9+
10+
11+ @pytest .fixture (scope = "function" , autouse = True )
12+ def reset_game_to_menu (port ):
13+ """Reset game to menu state before each test."""
14+ try :
15+ with BalatroClient (port = port ) as client :
16+ response = client .send_message ("go_to_menu" , {})
17+ game_state = G .model_validate (response )
18+ assert game_state .state_enum == State .MENU
19+ except (ConnectionFailedError , BalatroError ):
20+ # Game not running or other API error, skip setup
21+ pass
You can’t perform that action at this time.
0 commit comments