##// END OF EJS Templates
Merge pull request #3336 from takluyver/i3334...
Thomas Kluyver -
r10755:08de7c60 merge
parent child Browse files
Show More
@@ -959,9 +959,9 b' python-profiler package from non-free.""")'
959 raise UsageError("Can't use statement directly after '%%time'!")
959 raise UsageError("Can't use statement directly after '%%time'!")
960
960
961 if cell:
961 if cell:
962 expr = self.shell.prefilter(cell,False)
962 expr = self.shell.input_transformer_manager.transform_cell(cell)
963 else:
963 else:
964 expr = self.shell.prefilter(line,False)
964 expr = self.shell.input_transformer_manager.transform_cell(line)
965
965
966 # Minimum time above which parse time will be reported
966 # Minimum time above which parse time will be reported
967 tp_min = 0.1
967 tp_min = 0.1
@@ -301,6 +301,16 b' def test_time2():'
301 with tt.AssertPrints("CPU times: user "):
301 with tt.AssertPrints("CPU times: user "):
302 ip.run_cell("%time None")
302 ip.run_cell("%time None")
303
303
304 def test_time3():
305 """Erroneous magic function calls, issue gh-3334"""
306 ip = get_ipython()
307 ip.user_ns.pop('run', None)
308
309 with tt.AssertNotPrints("not found", channel='stderr'):
310 ip.run_cell("%%time\n"
311 "run = 0\n"
312 "run += 1")
313
304 def test_doctest_mode():
314 def test_doctest_mode():
305 "Toggle doctest_mode twice, it should be a no-op and run without error"
315 "Toggle doctest_mode twice, it should be a no-op and run without error"
306 _ip.magic('doctest_mode')
316 _ip.magic('doctest_mode')
General Comments 0
You need to be logged in to leave comments. Login now