No project description provided
Project description
shtest tests shell commands in your Sphinx documentation. The shtest
directive supports the usual doctest syntax. It offers two options: specifying the expected return code (defaults to 0) and choosing the stream to compare with (defaults to stdout).
Examples
# Obligatory hello world example.
$ echo hello world
hello world
:stream: stderr
# Read from stderr instead of stdout.
$ echo message on stderr >&2
message on stderr
:returncode: 1
# Use a non-zero expected return code.
$ false
# Run multiple tests in one directive.
$ echo hello
hello
$ echo world
world
:cwd: tests
# Run a test in a particular working directory relative to the document.
$ cat hello.txt
world
:tempdir:
# Run a test in a temporary directory.
$ echo hello > world.txt
Installation
Run pip install sphinxcontrib-shtest
to install the package and add "sphinxcontrib-shtest"
to your extensions
list in conf.py
(see here for details). Then execute sphinx-build -b shtest /path/to/source/directory /path/to/output/directory
.
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
Close
Hashes for sphinxcontrib-shtest-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67ff376a9211e86a40e86daffddb5a6fb60c1ae91ee0892318ff43d6788f47ac |
|
MD5 | f96beea5a521cd1609833d2cd04d1c56 |
|
BLAKE2b-256 | 09c011e8c66df16a5b6930a9a1d3dcdd6f02936707dad7f206bbbbc59f9d2171 |