File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import warnings
2+ from typing import Any , Generator
3+
24import pytest
35from fastapi .testclient import TestClient
46from main import app
5- from tests .player_stub import nonexistent_player
7+ from tests .player_stub import Player , nonexistent_player
68
79# Suppress the DeprecationWarning from httpx
810warnings .filterwarnings ("ignore" , category = DeprecationWarning )
@@ -24,14 +26,14 @@ def client():
2426
2527
2628@pytest .fixture (scope = "function" )
27- def nonexistent_player_in_db (client ) :
29+ def nonexistent_player_in_db (client : Any ) -> Generator [ Player , None , None ] :
2830 """
2931 Creates the nonexistent player in the database and removes it on teardown.
3032
3133 Yields:
3234 Player: The player stub created in the database.
3335 """
34- player = nonexistent_player ()
36+ player : Player = nonexistent_player ()
3537 client .post ("/players/" , json = player .__dict__ )
3638 yield player
3739 client .delete (f"/players/squadnumber/{ player .squad_number } " )
You can’t perform that action at this time.
0 commit comments