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

Method test_detached_stdin_binary_mode

Lib/test/test_fileinput.py:244–253  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

242 self.assertEqual(lines, [b'spam, bacon, sausage, and spam'])
243
244 def test_detached_stdin_binary_mode(self):
245 orig_stdin = sys.stdin
246 try:
247 sys.stdin = BytesIO(b'spam, bacon, sausage, and spam')
248 self.assertNotHasAttr(sys.stdin, 'buffer')
249 fi = FileInput(files=['-'], mode='rb')
250 lines = list(fi)
251 self.assertEqual(lines, [b'spam, bacon, sausage, and spam'])
252 finally:
253 sys.stdin = orig_stdin
254
255 def test_file_opening_hook(self):
256 try:

Callers

nothing calls this directly

Calls 5

BytesIOClass · 0.90
FileInputClass · 0.90
listClass · 0.85
assertNotHasAttrMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected