atelier.sheller

Defines the Sheller class for testing bash commands in a doctest.

Others have invented similar things before. For example doctest2 by Devin Jeanpierre. Another alternative is Clatter by Michael Delgado.

(This module’s source code is available here.)

Classes

Sheller([cwd])

A sheller is a little helper object to be used in tested documents for running shell scripts and testing their output.

class atelier.sheller.Sheller(cwd=None)

Bases: object

A sheller is a little helper object to be used in tested documents for running shell scripts and testing their output.

Usage example:

>>> import os
>>> from atelier.sheller import Sheller
>>> shell = Sheller(os.path.dirname(__file__))
>>> shell('ls *.py')
doctest_utf8.py
__init__.py
jarbuilder.py
projects.py
rstgen.py
setup_info.py
sheller.py
test.py
utils.py

When you don’t specify a directory, Sheller creates a temporary directory and has all processes run there.