MCPcopy
hub / github.com/tornadoweb/tornado / test_stderr

Method test_stderr

tornado/test/process_test.py:178–189  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

176
177 @gen_test
178 def test_stderr(self):
179 # This test is mysteriously flaky on twisted: it succeeds, but logs
180 # an error of EBADF on closing a file descriptor.
181 subproc = Subprocess(
182 [sys.executable, "-u", "-c", r"import sys; sys.stderr.write('hello\n')"],
183 stderr=Subprocess.STREAM,
184 )
185 self.addCleanup(lambda: self.term_and_wait(subproc))
186 data = yield subproc.stderr.read_until(b"\n")
187 self.assertEqual(data, b"hello\n")
188 # More mysterious EBADF: This fails if done with self.addCleanup instead of here.
189 subproc.stderr.close()
190
191 def test_sigchild(self):
192 Subprocess.initialize()

Callers

nothing calls this directly

Calls 4

term_and_waitMethod · 0.95
SubprocessClass · 0.90
read_untilMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected