Make sure last statement from time return a value.
()
| 455 | "run += 1") |
| 456 | |
| 457 | def test_multiline_time(): |
| 458 | """Make sure last statement from time return a value.""" |
| 459 | ip = get_ipython() |
| 460 | ip.user_ns.pop('run', None) |
| 461 | |
| 462 | ip.run_cell(dedent("""\ |
| 463 | %%time |
| 464 | a = "ho" |
| 465 | b = "hey" |
| 466 | a+b |
| 467 | """)) |
| 468 | nt.assert_equal(ip.user_ns_hidden['_'], 'hohey') |
| 469 | |
| 470 | def test_time_local_ns(): |
| 471 | """ |
nothing calls this directly
no test coverage detected