MCPcopy Index your code
hub / github.com/python/cpython / test_select_unbuffered

Method test_select_unbuffered

Lib/test/test_subprocess.py:3265–3280  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3263 stderr.decode('utf-8'))
3264
3265 def test_select_unbuffered(self):
3266 # Issue #11459: bufsize=0 should really set the pipes as
3267 # unbuffered (and therefore let select() work properly).
3268 select = import_helper.import_module("select")
3269 p = subprocess.Popen([sys.executable, "-c",
3270 'import sys;'
3271 'sys.stdout.write("apple")'],
3272 stdout=subprocess.PIPE,
3273 bufsize=0)
3274 f = p.stdout
3275 self.addCleanup(f.close)
3276 try:
3277 self.assertEqual(f.read(4), b"appl")
3278 self.assertIn(f, select.select([f], [], [], 0.0)[0])
3279 finally:
3280 p.wait()
3281
3282 def test_zombie_fast_process_del(self):
3283 # Issue #12650: on Unix, if Popen.__del__() was called before the

Callers

nothing calls this directly

Calls 7

waitMethod · 0.95
addCleanupMethod · 0.80
assertInMethod · 0.80
import_moduleMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected