Skip to content

Commit

Permalink
added test for ipythonGH-306
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanov committed Apr 3, 2011
1 parent d325df5 commit 1a81d3e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions IPython/core/tests/test_interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def test_naked_string_cells(self):
# 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()
Expand All @@ -54,4 +54,11 @@ def test_run_cell_multilne(self):
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)

0 comments on commit 1a81d3e

Please sign in to comment.