Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A pytest plugin to treat non-assertion failures as test errors.

Project Description

pytest-finer-verdicts

A pytest plugin to treat non-assertion failures as test errors.

Getting the plugin

The plugin can be installed via pip install pytest-finer-verdicts. Similarly, it can be uninstalled via pip uninstall pytest-finer-verdicts.

Usage

Consider the following snippet in a file test.py (available as temp/test.py in the repository).

import pytest


def test_pass():
    assert 70 <= 75


def test_fail():
    assert 75 <= 70


def test_error():
    raise RuntimeError()


def test_pytest_fail():
    pytest.fail("Fail")


def test_pytest_raises():
    with pytest.raises(ValueError):
        raise IndexError()

Without pytest-finer-verdicts plugin, py.test test.py -v will produce the following output.

collected 5 items

test.py::test_pass PASSED
test.py::test_fail FAILED
test.py::test_error ERROR
test.py::test_pytest_fail FAILED
test.py::test_pytest_raises ERROR

================================== ERRORS ===================================
_______________________ ERROR at setup of test_error ________________________

    def test_error():
>       raise RuntimeError()
E       RuntimeError

test.py:13: RuntimeError
___________________ ERROR at setup of test_pytest_raises ____________________

    def test_pytest_raises():
        with pytest.raises(ValueError):
>           raise IndexError()
E           IndexError

test.py:22: IndexError
================================= FAILURES ==================================
_________________________________ test_fail _________________________________

    def test_fail():
>       assert 75 <= 70
E       assert 75 <= 70

test.py:9: AssertionError
_____________________________ test_pytest_fail ______________________________

    def test_pytest_fail():
>       pytest.fail("Fail")
E       Failed: Fail

test.py:17: Failed
================ 2 failed, 1 passed, 2 error in 0.05 seconds ================

Notice how test_error and test_pytest_raises are flagged as test errors by the plugin.

Release History

Release History

This version
History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pytest_finer_verdicts-1.0.5-py2.py3-none-any.whl (4.7 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Aug 11, 2017
pytest-finer-verdicts-1.0.5.tar.gz (2.6 kB) Copy SHA256 Checksum SHA256 Source Aug 11, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting