Interlude for Doctests provides an Interactive Console.
Project description
Interlude - Interactive Doctests
Provides an interactive shell aka console inside your doctest case.
The console looks exact like in a doctest-case and you can copy and paste code from the shell into your doctest. It feels as you are in the test case itself. Its not pdb, it’s a python shell.
In your doctest you can invoke the shell at any point by calling:
>>> interact(locals())
To make your testrunner interlude aware, pass interact as a global to the DocFileSuite as shown here:
... import interlude ... suite = DocFileSuite( ..., globs=dict(interact=interlude.interact), ...) ...
If IPython is available it opens an IPython prompt. The prompt is modified and looks like in a doctest. To surpress the prompt modifications call interact with additional kwarg doctest_prompt=False.
License
interlude is copyright 2006-2014 by BlueDynamics Alliance, Klein & Partner KG, Austria. It is under the GNU Lesser General Public License (LGPLv3).
code repository at github collective
written by Jens Klein
IPython support contributed by Alan Justino
Upgrade/Bugfixes contributed by Sune Broendum Woeller
Changes
1.3
needs IPython 1.1.0 or better. Skipped support for older versions. [jensens, 2014-02-09]
added extra require, so when ipython is wanted just depend in buildout, pip-requirements, setup, (name it) on``interlude[ipython]`` [jensens, 2014-02-09]
start IPython shell with a custom doctest prompt, thus it is easier to copy-paste from the shell to the doctest (save a typing a %doctest_mode each time. Added also option doctest_prompt=False to disable this. [jensens, 2014-02-09]
1.2
make the ipython support work with newer ipython versions. [sunew]
1.1.1
fix broken release, include *.rst with MANIFEST.in
1.1
IPython support - alanjds, 2010-12-19
1.0
initial release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file interlude-1.3.tar.gz
.
File metadata
- Download URL: interlude-1.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8859e52f48d08dc502ca487696dfc2067b19ac5ca70bfafa3c07d4c63c083afc |
|
MD5 | ceec19dce025b862107f25ba06914ded |
|
BLAKE2b-256 | ce5a3e320a483593166143e90a429bd7df1dcb9c4ea834d2d74be72186e9179b |