test_exampleip.txt 816 B

123456789101112131415161718192021222324252627282930
  1. =================================
  2. Tests in example form - IPython
  3. =================================
  4. You can write text files with examples that use IPython prompts (as long as you
  5. use the nose ipython doctest plugin), but you can not mix and match prompt
  6. styles in a single file. That is, you either use all ``>>>`` prompts or all
  7. IPython-style prompts. Your test suite *can* have both types, you just need to
  8. put each type of example in a separate. Using IPython prompts, you can paste
  9. directly from your session::
  10. In [5]: s="Hello World"
  11. In [6]: s.upper()
  12. Out[6]: 'HELLO WORLD'
  13. Another example::
  14. In [8]: 1+3
  15. Out[8]: 4
  16. Just like in IPython docstrings, you can use all IPython syntax and features::
  17. In [9]: !echo "hello"
  18. hello
  19. In [10]: a='hi'
  20. In [11]: !echo $a
  21. hi