Skip to main content

Visualize your crappy tests

Project description

pytest-poo is a plugin for pytest that points out your crappy tests with piles of poo.

Really? Why?

I showed the –poo option at EuroPython 2013. A number of people thought I should release it, so here it is.

Screenshots

This is what the output usually looks like:

Normal mode, without poo

… when passing –poo, this is what is outputted instead:

Poo mode!

Requirements

A recent version of pytest is required (>= 2.3.4).

Quick start

  1. pip install pytest-poo

  2. Mark tests with the pytest.mark.poo marker.

  3. Run tests with the –poo option to enable pile of poo output.

Documentation

Marking tests

Add the pytest.mark.poo marker to the tests that you consider crappy. The markers are standard py.test markers and can be used like this on a test function:

import pytest

@pytest.mark.poo
def test_something():
    assert 0

or for classes:

import pytest

class MyTests(object):
    pytestmark = [pytest.mark.poo]

… or for entire modules:

import pytest

pytestmark = pytest.mark.poo


def test_a():
    assert 0


def test_b():
    assert 0

Showing crappy tests during test run

Just run py.test with the --poo option to enable the output. To always enable, add --poo to addopts in pytest.ini:

[pytest]
addopts = --poo

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

pytest-poo-1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

pytest_poo-1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest-poo-1.0.tar.gz.

File metadata

  • Download URL: pytest-poo-1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.9

File hashes

Hashes for pytest-poo-1.0.tar.gz
Algorithm Hash digest
SHA256 4a1d169d4c5466802ab03c14d41f71d5a9fed143f5f36753238c12b6e9a016e4
MD5 816ee866fdf6ed5305b73c9b87c85320
BLAKE2b-256 c12ae888aadb01d5bab9e917f029e92359ebb34ad974407c89df52085918ae80

See more details on using hashes here.

Provenance

File details

Details for the file pytest_poo-1.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_poo-1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.9

File hashes

Hashes for pytest_poo-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03650d0e3a6d8e6cb7c9e86a2cbc353aa204d7b83cbbb346620627aaa1e0885e
MD5 967a0c8b091734208f18b38a770d55d6
BLAKE2b-256 7127b915e332e0a8f6aa15d7b81b48b09dbb82a4ba0785e7585a3d9977a5d6fd

See more details on using hashes here.

Provenance

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