(base_app, capsys)
| 64 | |
| 65 | |
| 66 | def test_not_in_main_thread(base_app, capsys) -> None: |
| 67 | import threading |
| 68 | |
| 69 | # Mock threading.main_thread() to return our fake thread |
| 70 | saved_main_thread = threading.main_thread |
| 71 | fake_main = threading.Thread() |
| 72 | threading.main_thread = mock.MagicMock(name="main_thread", return_value=fake_main) |
| 73 | |
| 74 | with pytest.raises(RuntimeError) as excinfo: |
| 75 | base_app.cmdloop() |
| 76 | |
| 77 | # Restore threading.main_thread() |
| 78 | threading.main_thread = saved_main_thread |
| 79 | assert "cmdloop must be run in the main thread" in str(excinfo.value) |
| 80 | |
| 81 | |
| 82 | def test_empty_statement(base_app) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…