diff options
Diffstat (limited to 'contrib/python/ipython/py3/IPython/testing/plugin/dtexample.py')
| -rw-r--r-- | contrib/python/ipython/py3/IPython/testing/plugin/dtexample.py | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/contrib/python/ipython/py3/IPython/testing/plugin/dtexample.py b/contrib/python/ipython/py3/IPython/testing/plugin/dtexample.py index d73cd246fd2..68f7016e34d 100644 --- a/contrib/python/ipython/py3/IPython/testing/plugin/dtexample.py +++ b/contrib/python/ipython/py3/IPython/testing/plugin/dtexample.py @@ -4,6 +4,9 @@ This file just contains doctests both using plain python and IPython prompts. All tests should be loaded by nose. """ +import os + + def pyfunc(): """Some pure python tests... @@ -35,20 +38,8 @@ def ipfunc(): ....: print(i, end=' ') ....: print(i+1, end=' ') ....: - 0 1 1 2 2 3 - - - Examples that access the operating system work: - - In [1]: !echo hello - hello + 0 1 1 2 2 3 - In [2]: !echo hello > /tmp/foo_iptest - - In [3]: !cat /tmp/foo_iptest - hello - - In [4]: rm -f /tmp/foo_iptest It's OK to use '_' for the last result, but do NOT try to use IPython's numbered history of _NN outputs, since those won't exist under the @@ -59,7 +50,7 @@ def ipfunc(): In [8]: print(repr(_)) 'hi' - + In [7]: 3+4 Out[7]: 7 @@ -69,7 +60,26 @@ def ipfunc(): In [9]: ipfunc() Out[9]: 'ipfunc' """ - return 'ipfunc' + return "ipfunc" + + +def ipos(): + """Examples that access the operating system work: + + In [1]: !echo hello + hello + + In [2]: !echo hello > /tmp/foo_iptest + + In [3]: !cat /tmp/foo_iptest + hello + + In [4]: rm -f /tmp/foo_iptest + """ + pass + + +ipos.__skip_doctest__ = os.name == "nt" def ranfunc(): |
