From 6a2667e1b4c5a6b565a703f68400e8f4eaf1bcad 2016-06-01 11:14:10 From: Thomas Kluyver Date: 2016-06-01 11:14:10 Subject: [PATCH] Fix shellapp tests --- diff --git a/IPython/core/tests/test_shellapp.py b/IPython/core/tests/test_shellapp.py index 6e2e31b..8e15743 100644 --- a/IPython/core/tests/test_shellapp.py +++ b/IPython/core/tests/test_shellapp.py @@ -52,10 +52,9 @@ class TestFileToRun(unittest.TestCase, tt.TempFileMixin): src = "True\n" self.mktmp(src) - out = 'In [1]: False\n\nIn [2]:' - err = SQLITE_NOT_AVAILABLE_ERROR if sqlite_err_maybe else None - tt.ipexec_validate(self.fname, out, err, options=['-i'], + out, err = tt.ipexec(self.fname, options=['-i'], commands=['"__file__" in globals()', 'exit()']) + self.assertIn("False", out) @dec.skip_win32 @dec.skipif(PY3) @@ -64,7 +63,6 @@ class TestFileToRun(unittest.TestCase, tt.TempFileMixin): src = "from __future__ import division\n" self.mktmp(src) - out = 'In [1]: float\n\nIn [2]:' - err = SQLITE_NOT_AVAILABLE_ERROR if sqlite_err_maybe else None - tt.ipexec_validate(self.fname, out, err, options=['-i'], + out, err = tt.ipexec(self.fname, options=['-i'], commands=['type(1/2)', 'exit()']) + self.assertIn('float', out) diff --git a/IPython/testing/tools.py b/IPython/testing/tools.py index 73f4ee7..bf62f30 100644 --- a/IPython/testing/tools.py +++ b/IPython/testing/tools.py @@ -202,13 +202,7 @@ def ipexec(fname, options=None, commands=()): """ if options is None: options = [] - # For these subprocess calls, eliminate all prompt printing so we only see - # output from script execution - prompt_opts = [ '--PromptManager.in_template=""', - '--PromptManager.in2_template=""', - '--PromptManager.out_template=""' - ] - cmdargs = default_argv() + prompt_opts + options + cmdargs = default_argv() + options test_dir = os.path.dirname(__file__)