Allow xdoctest to accept IPython style doctests
Erotemic opened this issue · comments
Jon Crall commented
We could extend our allowed parsing formats to include an IPython-like syntax. For example:
In [4]: with ubelt.Timer('foo'):
...: _scipy_module()
...:
tic('foo')
...toc('foo')=0.0151s
In [5]: with ubelt.Timer('foo'):
...: _scipy_module()
...:
tic('foo')
...toc('foo')=0.0000s
The In [{num:d}]:
+ ...:
formatting should easy enough to parse out given the docstring. Once it is parsed into a doctest_example.Doctest object
, there should be no more issues.
Original idea from discussions around networkx/networkx#4295