()
| 213 | |
| 214 | |
| 215 | def test_run_cell(): |
| 216 | import textwrap |
| 217 | ip.run_cell('a = 10\na+=1') |
| 218 | ip.run_cell('assert a == 11\nassert 1') |
| 219 | |
| 220 | nt.assert_equal(ip.user_ns['a'], 11) |
| 221 | complex = textwrap.dedent(""" |
| 222 | if 1: |
| 223 | print "hello" |
| 224 | if 1: |
| 225 | print "world" |
| 226 | |
| 227 | if 2: |
| 228 | print "foo" |
| 229 | |
| 230 | if 3: |
| 231 | print "bar" |
| 232 | |
| 233 | if 4: |
| 234 | print "bar" |
| 235 | |
| 236 | """) |
| 237 | # Simply verifies that this kind of input is run |
| 238 | ip.run_cell(complex) |
| 239 | |
| 240 | |
| 241 | def test_db(): |