Skip to main content

Display tests you are uneasy with.

Project description

pytest-yuk

A pytest plugin that allows you to visualize tests you are not proud of, using 🤢 for pass, 🤮 for fail.

Installation

$ pip install pytest-yuk

Usage

Mark tests with @pytest.mark.yuk:

import pytest

@pytest.mark.yuk
def test_pass():
    assert 1 == 1

@pytest.mark.yuk
def test_fail():
    assert 1 == 2

def test_pass_unmarked():
    assert 1 == 1

def test_fail_unmarked():
    assert 1 == 2

Then run with --yuk:

$ pytest --yuk --tb=no test_yuk.py   
========================= test session starts ==========================
collected 4 items                                                      

test_yuk.py 🤢🤮.F                                               [100%]

===================== 2 failed, 2 passed in 0.02s ======================

Or --yuk -v:

$ pytest --yuk -v --tb=no test_yuk.py
========================= test session starts ==========================
collected 4 items                                                      

test_yuk.py::test_pass PASSED 🤢                                 [ 25%]
test_yuk.py::test_fail FAILED 🤮                                 [ 50%]
test_yuk.py::test_pass_unmarked PASSED                           [ 75%]
test_yuk.py::test_fail_unmarked FAILED                           [100%]

===================== 2 failed, 2 passed in 0.02s ======================

No output changes are made without the --yuk flag:

$ pytest --tb=no test_yuk.py   
========================= test session starts ==========================
collected 4 items                                                      

test_yuk.py .F.F                                                 [100%]

===================== 2 failed, 2 passed in 0.02s ======================

Similar project

This plugin was inspired by these other fine plugins:

Other pytest plugins from okken:

  • pytest-check: Allows multiple failures per test.
  • pytest-srcpaths: A plugin to help pytest find the code you want to test, by adding specified paths to sys.path.

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-yuk-0.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

pytest_yuk-0.0.1-py2.py3-none-any.whl (3.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pytest-yuk-0.0.1.tar.gz.

File metadata

  • Download URL: pytest-yuk-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for pytest-yuk-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3ad3c879abeee7d5ec3c2b6df26e545ecaea30bf1214ffb537625b33ea96aad1
MD5 128a5214b9c8379241a8ba5ec39bdf63
BLAKE2b-256 d1497278c4dd7809c89c73166c3db4a03b518d54d93462932b67bbcbd9b6b380

See more details on using hashes here.

File details

Details for the file pytest_yuk-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_yuk-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6b68dc1a9e91acf4c831c198d8ca19d9e9ee16dc0f41517636d1b8398760e18f
MD5 e553033acb1d49cee66c063934974a19
BLAKE2b-256 4abb346e2c82fdf2c6c8eb1f1e594e872609c44ab4bdb44cb4b714c749a79f45

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