Skip to content
Browse files

added test for GH-307

  • Loading branch information...
1 parent 1a81d3e commit 9e3dd316ee676af5ce79833b0add64f34906cc4b @ivanov ivanov committed Mar 25, 2011
Showing with 13 additions and 1 deletion.
  1. +13 −1 IPython/core/tests/test_interactiveshell.py
View
14 IPython/core/tests/test_interactiveshell.py
@@ -56,9 +56,21 @@ def test_run_cell_multiline(self):
self.assertEquals(ip.user_ns['y'], 3)
def test_multiline_string_cells(self):
- """Code sprinkled with multiline strings should execute (GH-306)"""
+ "Code sprinkled with multiline strings should execute (GH-306)"
ip = get_ipython()
ip.run_cell('tmp=0')
self.assertEquals(ip.user_ns['tmp'], 0)
ip.run_cell('tmp=1;"""a\nb"""\n')
self.assertEquals(ip.user_ns['tmp'], 1)
+
+ 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;')
+ newlen = len(ip.user_ns['Out'])
+ self.assertEquals(oldlen, newlen)
+ #also test the default caching behavior
+ a = ip.run_cell('1')
+ newlen = len(ip.user_ns['Out'])
+ self.assertEquals(oldlen+1, newlen)

0 comments on commit 9e3dd31

Please sign in to comment.
Something went wrong with that request. Please try again.