MCPcopy Create free account
hub / github.com/dbcli/mycli / make_fake_sys

Function make_fake_sys

test/pytests/test_main_modes_batch.py:153–159  ·  view source on GitHub ↗
(stdin_tty: bool, stderr_tty: bool | None = None)

Source from the content-addressed store, hash-verified

151
152
153def make_fake_sys(stdin_tty: bool, stderr_tty: bool | None = None) -> SimpleNamespace:
154 stderr = DummyStream(bool(stderr_tty))
155 return SimpleNamespace(
156 stdin=SimpleNamespace(isatty=lambda: stdin_tty),
157 stderr=stderr,
158 exit=sys.exit,
159 )
160
161
162def patch_progress_mode(monkeypatch, mycli_main, mycli_main_batch) -> None:

Calls 1

DummyStreamClass · 0.85

Tested by

no test coverage detected