From a46148b952a68376730ddaa05a1f2bd6cfcbc231 Mon Sep 17 00:00:00 2001 From: Paul Ivanov Date: Fri, 25 Mar 2011 02:41:52 -0700 Subject: [PATCH] added test for GH-284: ensure In variable is works --- IPython/core/tests/test_interactiveshell.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index 7762f894b33..bf411fe62da 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -71,6 +71,15 @@ def test_dont_cache_with_semicolon(self): newlen = len(ip.user_ns['Out']) self.assertEquals(oldlen, newlen) #also test the default caching behavior - a = ip.run_cell('1') + ip.run_cell('1') newlen = len(ip.user_ns['Out']) self.assertEquals(oldlen+1, newlen) + + 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;') + newlen = len(ip.user_ns['In']) + self.assertEquals(oldlen+1, newlen) + self.assertEquals(ip.user_ns['In'][-1],'1;')