Skip to main content
License See Build Status on Travis CI PyPI version Python versions

A pytest plugin that helps better distinguishing real test failures from setup flakiness.

Features

  • Re-running only the setup-phase on failure

  • Additional test-outcome: FAILED_TO_VERIFY if a failure happened in setup phase and prevented the actual test-logic from executing.

Installation

You can install the plugin using the following command:

$ pip install pytest-failed-to-verify

Usage

Based on the existing pytest-rerunfailures plugin we changed functionality to the following:

Once installed the plugin provides an additional test outcome failed-to-verify in case a test fails in the setup-phase, additionaly you are able to control the amount of re-runs specifically for the setup phase:

$ pytest --rerun-setup 1

What’s the idea behind it?

A pytest test consists of three phases (setup, call, teardown). Usually only the call phase contains the actual tested business logic and the outcome of this phase gives the most valuable result.

The setup phase is used to provide the pre-conditions for the test and might be even larger than the test.

Assuming that the flakiness of a test is evenly distributed between the lines of code a test is executing, having a large setup phase means an error due to flakiness is most likely to happen there. If that’s the case a test fails but is leaving you with no relevant test-outcome: the actual test did not happen.

So if the setup fails the result of a test will be failed-to-verify rather than failed.

Additionally re-running only the setup phase is a mechanism that assures the code that is testing the actual business logic (call-phase) is actually executed and provides you a valid test outcome without suffering from a flaky setup phase.

Credits

Credits to https://github.com/pytest-dev as some of the code was taken and re-used from the pytest-rerunfailures plugin. We used it as a starting point to implement the needed functionality.

Known issues

Because of the similarity it does not work well together with pytest-rerunfailures. If you still need to be able to rerun the complete test on case of an error you can do this as well using this plugin.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

Issues

If you encounter any problems, please file an issue along with a detailed description.


This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.

Release files for pytest-failed-to-verify 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-failed-to-verify 0.1.5
File Size Uploaded
pytest-failed-to-verify-0.1.5.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-failed-to-verify 0.1.5
File Interpreter ABI Platform
pytest_failed_to_verify-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size:22.8 kB

Release files / pytest-failed-to-verify-0.1.5.tar.gz

Download URL pytest-failed-to-verify-0.1.5.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ad23abe11117c1dd5a10d50f2d3f36bad19ae66e9c0dfc172f41468ba445c670
BLAKE2b-256 checksum
How to use checksums
d86c93429e8b78b3f216ddeba46f2b565f6b1cdb04546be360862ff855111fcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

Release files / pytest_failed_to_verify-0.1.5-py3-none-any.whl

Download URL pytest_failed_to_verify-0.1.5-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72b48bcda84d707797b1335c17f3614c8709d767ac2a5d290a647ace75ba29c3
BLAKE2b-256 checksum
How to use checksums
5f7c836ba7f8ec4b40a41d57dabe7ca4c2506b61e33a8c39eb2e4e085c7d175d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

1 release file

0.1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page