Show More
@@ -328,18 +328,6 b' class IPDocTestRunner(doctest.DocTestRunner,object):' | |||||
328 | """ |
|
328 | """ | |
329 |
|
329 | |||
330 | def run(self, test, compileflags=None, out=None, clear_globs=True): |
|
330 | def run(self, test, compileflags=None, out=None, clear_globs=True): | |
331 |
|
||||
332 | # Hack: ipython needs access to the execution context of the example, |
|
|||
333 | # so that it can propagate user variables loaded by %run into |
|
|||
334 | # test.globs. We put them here into our modified %run as a function |
|
|||
335 | # attribute. Our new %run will then only make the namespace update |
|
|||
336 | # when called (rather than unconditionally updating test.globs here |
|
|||
337 | # for all examples, most of which won't be calling %run anyway). |
|
|||
338 | #_ip._ipdoctest_test_globs = test.globs |
|
|||
339 | #_ip._ipdoctest_test_filename = test.filename |
|
|||
340 |
|
||||
341 | test.globs.update(_ip.user_ns) |
|
|||
342 |
|
||||
343 | # Override terminal size to standardise traceback format |
|
331 | # Override terminal size to standardise traceback format | |
344 | with modified_env({'COLUMNS': '80', 'LINES': '24'}): |
|
332 | with modified_env({'COLUMNS': '80', 'LINES': '24'}): | |
345 | return super(IPDocTestRunner,self).run(test, |
|
333 | return super(IPDocTestRunner,self).run(test, |
General Comments 0
You need to be logged in to leave comments.
Login now