Function
test_exit_code_nonzero
(exit_code_repl, monkeypatch)
Source from the content-addressed store, hash-verified
| 3658 | |
| 3659 | |
| 3660 | def test_exit_code_nonzero(exit_code_repl, monkeypatch) -> None: |
| 3661 | app = exit_code_repl |
| 3662 | |
| 3663 | read_input_mock = mock.MagicMock(name="_read_command_line", return_value="exit 23") |
| 3664 | monkeypatch.setattr("cmd2.Cmd._read_command_line", read_input_mock) |
| 3665 | |
| 3666 | expected = "exiting with code: 23\n" |
| 3667 | |
| 3668 | # Run the command loop |
| 3669 | app.cmdloop() |
| 3670 | out = app.stdout.getvalue() |
| 3671 | assert out == expected |
| 3672 | |
| 3673 | |
| 3674 | class AnsiApp(cmd2.Cmd): |
Callers
nothing calls this directly
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…