diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index ad8ebabc282..c621b58ad34 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2252,7 +2252,7 @@ def safe_execfile_ipy(self, fname): self.showtraceback() warn('Unknown failure executing file: <%s>' % fname) - def run_cell(self, raw_cell, store_history=True): + def run_cell(self, raw_cell, store_history=False): """Run a complete IPython cell. Parameters diff --git a/IPython/core/tests/test_history.py b/IPython/core/tests/test_history.py index 112665aa3fa..646b3de09b8 100644 --- a/IPython/core/tests/test_history.py +++ b/IPython/core/tests/test_history.py @@ -112,10 +112,10 @@ def test_extract_hist_ranges(): def test_magic_rerun(): """Simple test for %rerun (no args -> rerun last line)""" ip = get_ipython() - ip.run_cell("a = 10") - ip.run_cell("a += 1") + ip.run_cell("a = 10", store_history=True) + ip.run_cell("a += 1", store_history=True) nt.assert_equal(ip.user_ns["a"], 11) - ip.run_cell("%rerun") + ip.run_cell("%rerun", store_history=True) nt.assert_equal(ip.user_ns["a"], 12) def test_timestamp_type(): diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index 1ed515afbcd..350ad0aa0e2 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -73,11 +73,11 @@ def test_dont_cache_with_semicolon(self): "Ending a line with semicolon should not cache the returned object (GH-307)" ip = get_ipython() oldlen = len(ip.user_ns['Out']) - a = ip.run_cell('1;') + a = ip.run_cell('1;', store_history=True) newlen = len(ip.user_ns['Out']) self.assertEquals(oldlen, newlen) #also test the default caching behavior - ip.run_cell('1') + ip.run_cell('1', store_history=True) newlen = len(ip.user_ns['Out']) self.assertEquals(oldlen+1, newlen) @@ -85,7 +85,7 @@ def test_In_variable(self): "Verify that In variable grows with user input (GH-284)" ip = get_ipython() oldlen = len(ip.user_ns['In']) - ip.run_cell('1;') + ip.run_cell('1;', store_history=True) newlen = len(ip.user_ns['In']) self.assertEquals(oldlen+1, newlen) self.assertEquals(ip.user_ns['In'][-1],'1;') diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index bd3ab4fe680..fe82b86b2bc 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -171,7 +171,7 @@ def test_macro_run(): cmds = ["a=10", "a+=1", py3compat.doctest_refactor_print("print a"), "%macro test 2-3"] for cmd in cmds: - ip.run_cell(cmd) + ip.run_cell(cmd, store_history=True) nt.assert_equal(ip.user_ns["test"].value, py3compat.doctest_refactor_print("a+=1\nprint a\n")) with tt.AssertPrints("12"): diff --git a/IPython/frontend/terminal/interactiveshell.py b/IPython/frontend/terminal/interactiveshell.py index 411ed2ff566..22a4651a5ff 100644 --- a/IPython/frontend/terminal/interactiveshell.py +++ b/IPython/frontend/terminal/interactiveshell.py @@ -309,7 +309,7 @@ def interact(self, display_banner=None): self.edit_syntax_error() if not more: source_raw = self.input_splitter.source_raw_reset()[1] - self.run_cell(source_raw) + self.run_cell(source_raw, store_history=True) # We are off again... __builtin__.__dict__['__IPYTHON__active'] -= 1 diff --git a/IPython/zmq/ipkernel.py b/IPython/zmq/ipkernel.py index e2bf39a7d0a..94f1b9f8962 100755 --- a/IPython/zmq/ipkernel.py +++ b/IPython/zmq/ipkernel.py @@ -250,7 +250,7 @@ def execute_request(self, ident, parent): shell.run_code(code) else: # FIXME: the shell calls the exception handler itself. - shell.run_cell(code) + shell.run_cell(code, store_history=True) except: status = u'error' # FIXME: this code right now isn't being used yet by default,