Skip to main content

A unittest extension that provides additional information on test failure

Project description

.. image:: marbles.svg
:height: 150px
:width: 150px
:align: right


.. image::

.. image::

.. image::
:alt: Documentation Status

.. image::

Read better test failures.

* Free software: MIT license
* Documentation:


`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

.. code-block:: none

python -m marbles docs/examples/
FAIL: test_create_resource (docs.examples.getting_started.ResponseTestCase)
marbles.core.marbles.ContextualAssertionError: 409 != 201

Source (/path/to/docs/examples/
39 res = requests.put(endpoint, data=data)
> 40 self.assertEqual(
41 res.status_code,
42 201
43 )
data={'name': 'Little Bobby Tables', 'id': 1}

Ran 1 test in 0.002s

FAILED (failures=1)

You can also run your existing `unittest` tests with `marbles`

.. code-block:: bash

python -m marbles


.. code-block:: bash

pip install marbles

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
marbles.core-0.9.5-py2.py3-none-any.whl (22.4 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jun 24, 2018
marbles.core-0.9.5.tar.gz (16.1 kB) Copy SHA256 hash SHA256 Source None Jun 24, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page