Skip to main content

A unittest extension that provides additional information on test failure

Project description

marbles.svg

marbles

https://img.shields.io/pypi/v/marbles.svg Documentation Status https://codecov.io/gh/twosigma/marbles/branch/master/graph/badge.svg

Read better test failures.

Overview

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

Features

  • 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

Demo

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

getting_started.png

You can also run your existing unittest tests with marbles

python -m marbles test_module.py

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

python setup.py marbles

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

[aliases]
test = marbles

Installing

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.core-0.12.3.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

marbles.core-0.12.3-py2.py3-none-any.whl (23.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file marbles.core-0.12.3.tar.gz.

File metadata

  • Download URL: marbles.core-0.12.3.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for marbles.core-0.12.3.tar.gz
Algorithm Hash digest
SHA256 7841260bc04e687e55a6bc8a3471f0499243463702bb87b11259326cd8a6d6ef
MD5 4d97db59854cb8548d08071d26e673a4
BLAKE2b-256 349002f8608b0ea7de1f784bb7a1f10ac78a40daa7e01a4ac61f7d0f337b5e5b

See more details on using hashes here.

File details

Details for the file marbles.core-0.12.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for marbles.core-0.12.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8d37583b9a6862bd4c56355118b26b7d01f741b652bdca67461ae6c688ea5c48
MD5 1d7ba3a2d1da1cdb10d8c37778e84aad
BLAKE2b-256 bffd0d77ae32df769d7926b30b2827b41379d6b0a898434f146867e9870a23e1

See more details on using hashes here.

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