MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / test_quit

Function test_quit

tests/test_mancala.py:31–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30
31def test_quit():
32 board = mancala.getNewBoard()
33 # Test quitting:
34 with pytest.raises(SystemExit):
35 sys.stdin = io.StringIO('QUIT\n')
36 mancala.getPlayerMove('1', board)
37
38 with pytest.raises(SystemExit):
39 sys.stdin = io.StringIO('quit\n')
40 mancala.getPlayerMove('1', board)
41
42 with pytest.raises(SystemExit):
43 sys.stdin = io.StringIO('qUiT\n')
44 mancala.getPlayerMove('1', board)
45
46 with pytest.raises(SystemExit):
47 sys.stdin = io.StringIO(' quit \n')
48 mancala.getPlayerMove('1', board)
49
50
51def test_main(capsys):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected