pytest

pytest is a unit testing framework that attempts to be more "Pythonic." An important goal of it was to minimize the amount of additional code that had to be written in unittest in order to make tests run. pytest has often been described as "no-boilerplate" testing due to its minimal setup requirements. The home page for the project can be found at https://pytest.org/latest/index.html.

Installation

pytest can be installed using pip:

pip install pytest

One can test the installation as follows:

(my_rpy2_zone)-bash-4.1$ py.test --version
This is pytest version 2.8.7, imported from …

It is easy to invoke from the command line:

(my_rpy2_zone)-bash-4.1$ py.test
================================================= test session starts ================================================== ...

Get Mastering IPython 4.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.