No project description provided
Project description
shtest tests shell commands in your Sphinx documentation. The shtest
directive supports the usual doctest syntax. It offers the following options:
:returncode: [integer]
specifies the expected return code (defaults to 0).adding the
:stderr:
flag compares results with thestderr
rather thanstdout
stream.:cwd: [relative path]
specifies the working directory relative to the source of the document (defaults to the directory containing the source document).:tempdir:
executes the test in a temporary directory.
Examples
# Obligatory hello world example.
$ echo hello world
hello world
: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
Hashes for sphinxcontrib-shtest-0.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82840ee5976259e1a23e85c9de1dbb29a15cd899590597932095f45303c2d115 |
|
MD5 | f947750688498d6993ebe094b72b77fe |
|
BLAKE2b-256 | 58f7e0038af1b90809ec46c013f03690ab32df80b71ab3906b90b78d8d60f185 |