Skip to content

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

License

Notifications You must be signed in to change notification settings

okken/pytest-yuk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages