MCPcopy Index your code
hub / github.com/bpython/bpython / test_exec_dunder_file

Method test_exec_dunder_file

bpython/test/test_args.py:67–81  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65
66class TestExecArgs(unittest.TestCase):
67 def test_exec_dunder_file(self):
68 with tempfile.NamedTemporaryFile(mode="w") as f:
69 f.write(
70 dedent(
71 """\
72 import sys
73 sys.stderr.write(__file__)
74 sys.stderr.flush()"""
75 )
76 )
77 f.flush()
78 _, stderr = run_with_tty(
79 [sys.executable] + ["-m", "bpython.curtsies", f.name]
80 )
81 self.assertEqual(stderr.strip(), f.name)
82
83 def test_exec_nonascii_file(self):
84 with tempfile.NamedTemporaryFile(mode="w") as f:

Callers

nothing calls this directly

Calls 3

run_with_ttyFunction · 0.85
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected