(capsys)
| 180 | |
| 181 | |
| 182 | def test_main(capsys): |
| 183 | # Test basic game: |
| 184 | random.seed(42) |
| 185 | sys.stdin = io.StringIO('100\nS\n\n\n') |
| 186 | with pytest.raises(SystemExit): |
| 187 | blackjack.main() |
| 188 | captured = capsys.readouterr() |
| 189 | assert '|3 | |10 |' in captured.out |
| 190 | |
| 191 | # Test quitting: |
| 192 | random.seed(42) |
| 193 | sys.stdin = io.StringIO('quit\n') |
| 194 | with pytest.raises(SystemExit): |
| 195 | blackjack.main() |
nothing calls this directly
no outgoing calls
no test coverage detected