From 1a81d3e12d129bcebc6d49a0d4e931dfdff3220b 2011-04-03 06:42:58 From: Paul Ivanov Date: 2011-04-03 06:42:58 Subject: [PATCH] added test for GH-306 --- diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index 41419b9..ab94bc0 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -35,14 +35,14 @@ class InteractiveShellTestCase(unittest.TestCase): # And also multi-line cells ip.run_cell('"""a\nb"""\n') self.assertEquals(ip.user_ns['_'], 'a\nb') - + def test_run_empty_cell(self): """Just make sure we don't get a horrible error with a blank cell of input. Yes, I did overlook that.""" ip = get_ipython() ip.run_cell('') - def test_run_cell_multilne(self): + def test_run_cell_multiline(self): """Multi-block, multi-line cells must execute correctly. """ ip = get_ipython() @@ -54,4 +54,11 @@ class InteractiveShellTestCase(unittest.TestCase): ip.run_cell(src) self.assertEquals(ip.user_ns['x'], 2) self.assertEquals(ip.user_ns['y'], 3) - + + def test_multiline_string_cells(self): + """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)