Browse files

added test for GH-307

  • Loading branch information...
1 parent c8e0102 commit d1ba2d4db1b5e7f56b59b3d96858fe5abc15d0da @ivanov committed Mar 25, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 IPython/core/tests/test_interactiveshell.py
View
15 IPython/core/tests/test_interactiveshell.py
@@ -41,10 +41,23 @@ def test_run_empty_cell(self):
cell of input. Yes, I did overlook that."""
ip = get_ipython()
ip.run_cell('')
+
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 d1ba2d4

Please sign in to comment.