Show More
@@ -52,5 +52,9 b' class TestFileToRun(unittest.TestCase, tt.TempFileMixin):' | |||||
52 | self.mktmp(src) |
|
52 | self.mktmp(src) | |
53 |
|
53 | |||
54 | out, err = tt.ipexec(self.fname, options=['-i'], |
|
54 | out, err = tt.ipexec(self.fname, options=['-i'], | |
55 | commands=['"__file__" in globals()', 'exit()']) |
|
55 | commands=['"__file__" in globals()', 'print(123)', 'exit()']) | |
56 | self.assertIn("False", out) |
|
56 | if 'False' not in out: | |
|
57 | print("Subprocess stderr:") | |||
|
58 | print(err) | |||
|
59 | print('-----') | |||
|
60 | raise AssertionError("'False' not found in %r" % out) |
@@ -229,16 +229,15 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
229 | def init_prompt_toolkit_cli(self): |
|
229 | def init_prompt_toolkit_cli(self): | |
230 | if self.simple_prompt: |
|
230 | if self.simple_prompt: | |
231 | # Fall back to plain non-interactive output for tests. |
|
231 | # Fall back to plain non-interactive output for tests. | |
232 |
# This is very limited |
|
232 | # This is very limited. | |
233 | def prompt(): |
|
233 | def prompt(): | |
234 |
i |
|
234 | itm = self.input_transformer_manager | |
235 | prompt_text = "".join(x[1] for x in self.prompts.in_prompt_tokens()) |
|
235 | prompt_text = "".join(x[1] for x in self.prompts.in_prompt_tokens()) | |
|
236 | lines = [input(prompt_text)] | |||
236 | prompt_continuation = "".join(x[1] for x in self.prompts.continuation_prompt_tokens()) |
|
237 | prompt_continuation = "".join(x[1] for x in self.prompts.continuation_prompt_tokens()) | |
237 | while isp.push_accepts_more(): |
|
238 | while not itm.check_complete('\n'.join(lines)): | |
238 |
line |
|
239 | lines.append( input(prompt_continuation) ) | |
239 |
|
|
240 | return '\n'.join(lines) | |
240 | prompt_text = prompt_continuation |
|
|||
241 | return isp.source_reset() |
|
|||
242 | self.prompt_for_code = prompt |
|
241 | self.prompt_for_code = prompt | |
243 | return |
|
242 | return | |
244 |
|
243 |
General Comments 0
You need to be logged in to leave comments.
Login now