Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a2667e

Browse files
committed
Fix shellapp tests
1 parent 94cfb0e commit 6a2667e

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

IPython/core/tests/test_shellapp.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ def test_py_script_file_attribute_interactively(self):
5252
src = "True\n"
5353
self.mktmp(src)
5454

55-
out = 'In [1]: False\n\nIn [2]:'
56-
err = SQLITE_NOT_AVAILABLE_ERROR if sqlite_err_maybe else None
57-
tt.ipexec_validate(self.fname, out, err, options=['-i'],
55+
out, err = tt.ipexec(self.fname, options=['-i'],
5856
commands=['"__file__" in globals()', 'exit()'])
57+
self.assertIn("False", out)
5958

6059
@dec.skip_win32
6160
@dec.skipif(PY3)
@@ -64,7 +63,6 @@ def test_py_script_file_compiler_directive(self):
6463
src = "from __future__ import division\n"
6564
self.mktmp(src)
6665

67-
out = 'In [1]: float\n\nIn [2]:'
68-
err = SQLITE_NOT_AVAILABLE_ERROR if sqlite_err_maybe else None
69-
tt.ipexec_validate(self.fname, out, err, options=['-i'],
66+
out, err = tt.ipexec(self.fname, options=['-i'],
7067
commands=['type(1/2)', 'exit()'])
68+
self.assertIn('float', out)

IPython/testing/tools.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,7 @@ def ipexec(fname, options=None, commands=()):
202202
"""
203203
if options is None: options = []
204204

205-
# For these subprocess calls, eliminate all prompt printing so we only see
206-
# output from script execution
207-
prompt_opts = [ '--PromptManager.in_template=""',
208-
'--PromptManager.in2_template=""',
209-
'--PromptManager.out_template=""'
210-
]
211-
cmdargs = default_argv() + prompt_opts + options
205+
cmdargs = default_argv() + options
212206

213207
test_dir = os.path.dirname(__file__)
214208

0 commit comments

Comments
 (0)