MCPcopy Create free account
hub / github.com/ezyang/ghstack / test_stdout_with_stderr_prefix

Method test_stdout_with_stderr_prefix

test_shell.py:93–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

91 )
92
93 def test_stdout_with_stderr_prefix(self) -> None:
94 # What most commands should look like
95 with self.assertLogs(level=logging.DEBUG) as cm:
96 self.emit(
97 err(r"Step 1...\n"),
98 err(r"Step 2...\n"),
99 err(r"Step 3...\n"),
100 out(r"out\n"),
101 stdout=None,
102 )
103 self.assertExpectedInline(
104 self.flog(cm),
105 """\
106$ python emitter.py e 'Step 1...\\n' e 'Step 2...\\n' e 'Step 3...\\n' o 'out\\n'
107# stderr:
108Step 1...
109Step 2...
110Step 3...
111
112# stdout:
113out
114""",
115 )
116
117 def test_interleaved_stdout_stderr_passthru(self) -> None:
118 # NB: stdout is flushed in each of these cases

Callers

nothing calls this directly

Calls 4

emitMethod · 0.95
flogMethod · 0.95
errClass · 0.85
outClass · 0.85

Tested by

no test coverage detected