Skip to main content

A testing utility package

Project description

Project Title

A lightweight decorator based testing package for Python 3.5+.


The easiest way to install is to use pip:

pip install zest


python3 -m pip install zest

You can also download the source and place it the directory of the module you want to use it in. An example directory structure is shown below:

  • project_directory
    • zest
      • zest's files here

Getting Started

A suggested workflow is to write the test first in a seperate file, like so:

from zest import tests, raises, test_all
import main

def test_squared(func = None):
    """Ensure squaring is done accureately and only squarable types are squared"""
    # Make sure ValueError is thrown if invalid imputs are given
    assert raises(TypeError, func, "NaN"), "Should raise TypeError when 'NaN' supplied"

    assert raises(TypeError, func, {1, 2, 3}), "Should raise TypeError when {1, 2, 3} supplied"

    assert func(4) == 16, "4^2 is 16, received %s" % func(4)
    assert func(5) == 25, "5^2 is 25, received %s" % func(5)


Note multiple tests can be placed in one test function. simply contains a function called squared that squares the input and returns it.

Zest keeps track of all registered testing functions, allowing you to run them all at once, and get grouped information on the results of the test, like so:


At the moment test_all() only returns a pretty print output, but in the future this will be fleshed out to be more comprehensive


Python 3.5+


Jeremy Zolnai-Lucas - Initial work - Jezza672


This project is licensed under the MIT License - see the LICENSE file for details

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

zest-0.1.1.post1.tar.gz (3.0 kB view hashes)

Uploaded source

Built Distribution

zest-0.1.1.post1-py3-none-any.whl (3.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page