Skip to main content

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

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

Uploaded Source

Built Distribution

marbles.mixins-0.12.3-py2.py3-none-any.whl (14.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for marbles.mixins-0.12.3.tar.gz
Algorithm Hash digest
SHA256 ad2be2c394b3fa751b2ce1f078fe364a7a5c9556334c9370a7f2fc36d9df4ccd
MD5 a6acba86244db16f695a6a2a51bee0ff
BLAKE2b-256 86028c900d8c1e4677d439c1b8ad147b194180a0e2bd38ef0c67fd5a892aae58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marbles.mixins-0.12.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0d4a13640c1559835b89c6fc16b0c270859661c72a86a4acc829b4d04db654c7
MD5 5a9798890ad6091b04c5e00f1d9229b6
BLAKE2b-256 fc2e23a83734b2d75539854b6f7dea5dbed5c351fdc1360a6463f6e0b04c1806

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