Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

UNIX command-line tool for bash/shell utils unit testing

Project Description

|CircleCI| |version|

|pyversions| |license|

**Author**: `Pahaz Blinov`_


BashTest is a UNIX command-line tool for the testing bash/shell utilites.

This is a simplest way to write simple bash tests.

**requirements**: Python2 or Python3

**keywords**: bash unittest, unittesting, bash tesing, sh unit testing


`bashtest`_ is on PyPI, so simply run:


pip install bashtest

or ::

easy_install bashtest

to have it installed in your environment.

For installing from source, clone the
`repo <>`_ and run::

python install

If you don`t have **pip** you can `install it <>`_

Typical use case

You have a command line util or bash/sh script and you want to test it.

For example, we want to test **ls** util.

All of we need is to create text file with execution log.

**./test_ls.bashtest** ::

$ ls ./testsuit/list-directory

Run this tests ::

$ bashtest test_ls.bashtest
1 items passed all tests:
1 tests in test_ls.bashtest
1 tests in 1 items.
1 passed and 0 failed.
Test passed.

Test README examples

You have a some open source project like this. And of course, as in any good
open source project, you have examples. You can automatically check this
examples. Just add **bashtest README.rst** in your CI tests.

More examples

You can finde some examples in this project. Please check **test_*.bashtest**


** 0.0.7 **
- fix! remove ugly and useless options
- feat! Test README.rst `#4 <>`_
- feat! find *.bashtest by default `#3 <>`_

** 0.0.6 **
- fix! bad command escaping bug `#5 <>`_



$ bashtest --help
usage: bashtest [-h] [--exitcode] [-v] [-q] [--debug] [--version]
[file [file ...]]

BashTest is a UNIX command-line tool for running text-based bash tests.

positional arguments:
file Input file (by default uses *.bashtest)

optional arguments:
-h, --help show this help message and exit
--exitcode Print exitcode after command end of output
-v, --verbose Verbose output mode
-q, --quiet Silent output mode
--debug Print the debug information
--version Print the version string

.. _Pahaz Blinov:
.. _bashtest:
.. |CircleCI| image::
.. |DwnMonth| image::
.. |DwnWeek| image::
.. |DwnDay| image::
.. |pyversions| image::
.. |version| image::
:target: `bashtest`_
.. |license| image::

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(6.2 kB) Copy SHA256 Hash SHA256
Source None Aug 26, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate