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

Method test_close_stdin

Lib/test/test_repl.py:162–175  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

160 self.assertIn(long_value, output)
161
162 def test_close_stdin(self):
163 user_input = dedent('''
164 import os
165 print("before close")
166 os.close(0)
167 ''')
168 prepare_repl = dedent('''
169 from test.support import suppress_msvcrt_asserts
170 suppress_msvcrt_asserts()
171 ''')
172 process = spawn_repl('-c', prepare_repl)
173 output = process.communicate(user_input)[0]
174 self.assertEqual(process.returncode, 0)
175 self.assertIn('before close', output)
176
177 def test_interactive_traceback_reporting(self):
178 user_input = "1 / 0 / 3 / 4"

Callers

nothing calls this directly

Calls 5

dedentFunction · 0.90
spawn_replFunction · 0.85
assertInMethod · 0.80
communicateMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected