Skip to main content

Semantically-rich assertions for use in marbles and unittest test cases

Project description


marbles Documentation Status

Read better test failures.


marbles is a Python unittest extension that allows test authors to write richer tests that expose more information on test failure to help you debug failing tests faster.

  • Treat test failures as documentation

  • Contextualize failures without digging through test code and dropping debugging statements everywhere

  • Write clearer, more explicit tests


  • Drop-in unittest replacement

  • Information-rich failure messages

    • The full statement that failed (instead of just the last line)

    • Local variables in scope at the time the test failed

    • Optional annotation provided by the test author with details about the test

    • Ability to toggle traceback

  • Semantically-rich assertion methods

  • Assertion logging


You can run the example tests provided to see what a marbles failure message looks like


You can also run your existing unittest tests with marbles

python -m marbles

Marbles also creates a setuptools command so if you are used to running python test, you can now run:

python marbles

You can go one step further and alias the command test to run marbles by adding the following to setup.cfg:

test = marbles


pip install marbles

Download files

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

Source Distribution

marbles.mixins-0.12.1.tar.gz (14.1 kB view hashes)

Uploaded source

Built Distribution

marbles.mixins-0.12.1-py2.py3-none-any.whl (14.4 kB view hashes)

Uploaded py2 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