Skip to main content

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).

Changes

1.3.1

  • refactoring introduced bug: classic prompt use_ipython=False fails if IPython available [jensens, 2014-02-09]

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

Metadata

Release files for interlude 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for interlude 1.3.1
File Size Uploaded
interlude-1.3.1.tar.gz 3.5 kB Details

Release files / interlude-1.3.1.tar.gz

Download URL interlude-1.3.1.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e41685040cc7c719a63d8a798836a52017fe67460ba7379983f70f54937e4cfb
BLAKE2b-256 checksum
How to use checksums
e73eb72f924348a85b970e3a17dba4eb2bc5ca907ed24c0a1e3023394011b3c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.3.1 This release

1 release file

1.3

1 release file

1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page