Skip to content

Commit 5169a71

Browse files
nanotaboadaclaude
andcommitted
test(conftest): add type hints to nonexistent_player_in_db fixture (#549)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent de436f6 commit 5169a71

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import warnings
2+
from typing import Any, Generator
3+
24
import pytest
35
from fastapi.testclient import TestClient
46
from 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
810
warnings.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}")

0 commit comments

Comments
 (0)