Install & Compatibility
Where this runs
tested against v0.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 31.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.7s · import 0.000s · 32MB
30MB installed
● package 30MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Plugin Activation
✓ This is a pytest plugin and is activated via the command line (--instafail) or automatically by pytest upon installation. It does not require explicit Python 'import' statements in user code.
pytest plugins are typically auto-discovered or activated via CLI flags.
To use pytest-instafail, simply install it and then run your tests with the `--instafail` flag. This will cause failures to be reported instantly.
import pytest
def test_passing_example():
assert True
def test_failing_example():
assert False
# To run this, save as 'test_example.py' and execute in terminal:
# pytest --instafail test_example.py
Debug
Known issues
breakingVersion 0.5.0 dropped support for Python 3.6. Ensure your environment uses Python 3.7 or newer.fixUpgrade Python to 3.7+ or use an older version of pytest-instafail (e.g., 0.4.x) if Python 3.6 is a strict requirement.
affects: <0.5.0
breakingpytest-instafail requires pytest 5 or newer. Using it with older pytest versions may lead to compatibility issues or errors.fixUpgrade pytest to version 5 or newer (`pip install --upgrade pytest`).
affects: <0.5.0 (with pytest < 5)
deprecatedOlder versions of pytest-instafail might issue deprecation warnings when used with pytest 7.2.0+ due to changes in hook configuration. Version 0.5.0 addressed this by using `pytest.hookimpl`.fixUpgrade to pytest-instafail 0.5.0 or newer to ensure compatibility and avoid deprecation warnings with recent pytest versions.
affects: <0.5.0 (with pytest >= 7.2.0)
gotchaWhen used in conjunction with `pytest-xdist`, ensure `pytest-instafail` is at least version 0.4.2 to avoid issues related to deprecated `pytest-xdist` slave aliases.fixUpgrade to pytest-instafail 0.4.2 or newer if using `pytest-xdist` for parallel test execution.
affects: <0.4.2 (with pytest-xdist)
Upgrade
Version history
0.5.0latest on PyPI · released Mar 31, 2023
Audit
Dependencies
pytestrequiredCore testing framework that this plugin extends.