Show More
@@ -56,9 +56,21 b' class InteractiveShellTestCase(unittest.TestCase):' | |||||
56 | self.assertEquals(ip.user_ns['y'], 3) |
|
56 | self.assertEquals(ip.user_ns['y'], 3) | |
57 |
|
57 | |||
58 | def test_multiline_string_cells(self): |
|
58 | def test_multiline_string_cells(self): | |
59 |
|
|
59 | "Code sprinkled with multiline strings should execute (GH-306)" | |
60 | ip = get_ipython() |
|
60 | ip = get_ipython() | |
61 | ip.run_cell('tmp=0') |
|
61 | ip.run_cell('tmp=0') | |
62 | self.assertEquals(ip.user_ns['tmp'], 0) |
|
62 | self.assertEquals(ip.user_ns['tmp'], 0) | |
63 | ip.run_cell('tmp=1;"""a\nb"""\n') |
|
63 | ip.run_cell('tmp=1;"""a\nb"""\n') | |
64 | self.assertEquals(ip.user_ns['tmp'], 1) |
|
64 | self.assertEquals(ip.user_ns['tmp'], 1) | |
|
65 | ||||
|
66 | def test_dont_cache_with_semicolon(self): | |||
|
67 | "Ending a line with semicolon should not cache the returned object (GH-307)" | |||
|
68 | ip = get_ipython() | |||
|
69 | oldlen = len(ip.user_ns['Out']) | |||
|
70 | a = ip.run_cell('1;') | |||
|
71 | newlen = len(ip.user_ns['Out']) | |||
|
72 | self.assertEquals(oldlen, newlen) | |||
|
73 | #also test the default caching behavior | |||
|
74 | a = ip.run_cell('1') | |||
|
75 | newlen = len(ip.user_ns['Out']) | |||
|
76 | self.assertEquals(oldlen+1, newlen) |
General Comments 0
You need to be logged in to leave comments.
Login now