mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 15:37:51 -08:00
Python: Add tests and type annotations
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import io
|
||||
from unittest import mock
|
||||
from typing import TypeVar
|
||||
from _pytest.capture import CaptureFixture
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
|
||||
from acey_ducey import play_game
|
||||
|
||||
|
||||
@mock.patch("random.shuffle")
|
||||
def test_play_game_lose(mock_random_shuffle, monkeypatch, capsys) -> None:
|
||||
def test_play_game_lose(mock_random_shuffle, monkeypatch: MonkeyPatch, capsys: CaptureFixture) -> None:
|
||||
monkeypatch.setattr("sys.stdin", io.StringIO("100\n100"))
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user