Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow xdoctest to accept IPython style doctests #89

Open
Erotemic opened this issue Nov 10, 2020 · 0 comments
Open

Allow xdoctest to accept IPython style doctests #89

Erotemic opened this issue Nov 10, 2020 · 0 comments

Comments

@Erotemic
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant