pytest -- a testing interpreter for Python
pytest pattern
Pytest is a testing interpreter for Python. It differs from a testing framework in that tests written for pytest involve no framework apart from the Python language itself. Pytests are regular Python scripts that are interpreted in a special way. Specifically, all explicit comparison statements (i.e., those with a comparison operator), are interpreted as tests, and their results are tallied and reported on following execution of the script.
Pytest will process all files in the current directory that match the Unix filename pattern pattern. If more than one file matches (or if pattern is not equivalent to a single matching filename), then pytest will report on the results in aggregate as well as individually.
The doc/tutorial.pyt file included with the distribution discusses pytest usage in detail.
This program is known to work with the following software:
Test a single file, sending the report to your pager:
$ pytest tutorial.pyt | less
Test all files in the current directory with the .pyt extension:
$ pytest ‘*.pyt’
Remember to quote a pattern with special characters so that your shell does not expand it before pytest has a chance to.
2005-05-02 version 0.3.0, first development release
(c) 2005 Chad Whitacre <http://www.zetadev.com/> This program is beerware. If you like it, buy me a beer someday. No warranty is expressed or implied.