Skip to main content

Pytest plugin Mark test as a bug

Project description

PyPI Build Status PyPI - Python Version pytes_support Downloads

Install

pip install pytest-bug

Example

import pytest


@pytest.mark.bug('skip')
def test_one():
    assert False


@pytest.mark.bug('fail', run=True)
def test_two():
    assert False


@pytest.mark.bug('pass', run=True)
def test_three():
    assert True


@pytest.mark.bug('skip class')
class TestFour:

    def test_one(self):
        assert False

    def test_two(self):
        assert True


@pytest.mark.bug('class', run=True)
class TestFive:

    def test_one(self):
        assert False

    def test_two(self):
        assert True
$ pytest

======================== test session starts ========================
platform linux -- Python 3.x.y, pytest-x.y.z, py-x.y.z, pluggy-x.y.z
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR
plugins: bug-x.y.z
collected 7 items

test_sample.py bfpbbfp

---------- Bugs skipped: 3 Bugs passed: 2 Bugs failed: 2 ----------
=================== 2 passed, 5 skipped in 0.10s ===================

Symbols:

  • b - bug skip

  • f - bug fail

  • p - bug pass

verbosity

$ pytest -v

======================== test session starts ========================
platform linux -- Python 3.x.y, pytest-x.y.z, py-x.y.z, pluggy-x.y.z
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR
plugins: bug-x.y.z
collected 7 items

test_sample.py::test_one BUG-SKIP                          [ 14%]
test_sample.py::test_two BUG-FAIL                          [ 28%]
test_sample.py::test_three BUG-PASS                        [ 42%]
test_sample.py::TestFour::test_one BUG-SKIP                [ 57%]
test_sample.py::TestFour::test_two BUG-SKIP                [ 71%]
test_sample.py::TestFive::test_one BUG-FAIL                [ 85%]
test_sample.py::TestFive::test_two BUG-PASS                [100%]

---------- Bugs skipped: 3 Bugs passed: 2 Bugs failed: 2 ----------
=================== 2 passed, 5 skipped in 0.10s ===================

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pytest_bug-0.4.6-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pytest_bug-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: pytest_bug-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for pytest_bug-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 14e765c51ac60bfc9923c50851fc60f16f4849a1262253b36ada2aab5bb15223
MD5 153e3ea2ce565d9af932068e7e4d6dc0
BLAKE2b-256 40627b52de33e6773562182d68261d1f81093938748faacc83ff4677efddd8fb

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