[Python-checkins] cpython: Note why we can't write an automated test for the code path that brings up the
nick.coghlan
python-checkins at python.org
Sun Jul 15 10:24:52 CEST 2012
http://hg.python.org/cpython/rev/777bd189f0f1
changeset: 78108:777bd189f0f1
user: Nick Coghlan <ncoghlan at gmail.com>
date: Sun Jul 15 18:24:42 2012 +1000
summary:
Note why we can't write an automated test for the code path that brings up the REPL for a bare 'python' call
files:
Lib/test/test_cmd_line_script.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -143,6 +143,9 @@
self.assertIn(expected, out)
def test_stdin_loader(self):
+ # Unfortunately, there's no way to automatically test the fully
+ # interactive REPL, since that code path only gets executed when
+ # stdin in an interactive tty.
p = spawn_python()
try:
p.stdin.write(b"print(__loader__)\n")
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list