(monkeypatch)
| 35 | |
| 36 | @pytest.fixture |
| 37 | async def console(monkeypatch) -> ConsoleTestMaster: # noqa |
| 38 | # monkeypatch.setattr(window.Screen, "get_cols_rows", lambda self: (120, 120)) |
| 39 | monkeypatch.setattr(window.Screen, "start", lambda *_: True) |
| 40 | monkeypatch.setattr(ConsoleTestMaster, "sig_call_in", lambda *_, **__: True) |
| 41 | monkeypatch.setattr(sys.stdout, "isatty", lambda: True) |
| 42 | |
| 43 | # extremely hacky: the console UI heavily depends on global signals |
| 44 | # that are unfortunately shared across tests |
| 45 | # Here we clear all existing signals so that we don't interact with previous instantiations. |
| 46 | for sig in signals.__dict__.values(): |
| 47 | if isinstance(sig, _SignalMixin): |
| 48 | sig.receivers.clear() |
| 49 | |
| 50 | opts = options.Options() |
| 51 | m = ConsoleTestMaster(opts) |
| 52 | opts.server = False |
| 53 | opts.console_mouse = False |
| 54 | await m.running() |
| 55 | yield m |
| 56 | await m.done() |
nothing calls this directly
no test coverage detected
searching dependent graphs…