Registry / testing / pytest-ignore-test-results

pytest-ignore-test-results

JSON →
library0.3.0pypypiunverified

pytest-ignore-test-results is a pytest plugin that enables selective test result ignoring while maintaining test execution. It allows users to specify test cases (by name or pattern) whose failures should not result in a non-zero exit code from pytest. The current version is 0.3.0, and it is actively maintained by Espressif, with releases occurring as needed for updates and new features.

pip install -U pytest-ignore-test-results
INSTALL
IMPORT
SIG · PYTEST-IGNORE-TEST
P
pytest-ignore-test-results
testingpythonv0.3.0
Install
2.7s avg
Import
—
Disk
29MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.3.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
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 30.8MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 2.7s · import 0.000s · 31MB
29MB installed
● package 29MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytest_ignore_test_results
✓ This plugin is primarily configured via command-line options or pytest hooks, rather than direct Python imports for its core functionality. For example, to customize test case names, you might implement the 'pytest_custom_test_case_name' hook in a conftest.py file.
The plugin auto-registers with pytest upon installation. There are no common user-facing imports for its core ignoring mechanism.

This quickstart demonstrates how to use `pytest-ignore-test-results` via command-line arguments to selectively ignore test failures. It shows how to specify individual test cases or patterns, load ignore lists from files, and control exit codes for CI/CD pipelines. Note that ignored tests still execute.

# First, ensure you have pytest and the plugin installed: # pip install pytest pytest-ignore-test-results # Create a test file (e.g., test_example.py) # ---------------------------------------- # def test_passing(): # assert True # # def test_failing_critical(): # assert False, "This test MUST NOT be ignored" # # def test_failing_but_ignorable(): # assert False, "This test's failure can be ignored" # ---------------------------------------- # Run pytest, ignoring the result of 'test_failing_but_ignorable': # The test will still run, but its failure won't cause pytest to exit with a non-zero code # unless --strict-exit-code is used and ALL failures are ignored. # Expected output will show 'xfailed' or 'ignored' for the specified test. print("Run with: pytest --ignore-result-cases 'test_failing_but_ignorable' test_example.py") # Example of ignoring tests based on a pattern: print("Run with: pytest --ignore-result-cases 'test_failing_*' test_example.py") # Example of loading ignore patterns from a file (e.g., ignore_list.txt): # Content of ignore_list.txt: # test_failing_but_ignorable # test_feature_* print("Run with: pytest --ignore-result-files ignore_list.txt test_example.py") # To exit with code 6 if all failed tests are ignored: print("Run with: pytest --ignore-result-cases 'test_failing_but_ignorable' --strict-exit-code test_example.py")
Debug
Known issues
gotchaThis plugin *runs* tests and then *ignores their results*, which is distinct from `pytest.mark.skip` or `pytest --ignore`. Skipped tests (`@pytest.mark.skip`) are not executed at all, while ignored tests via this plugin will still consume execution time and resources.
fix
Understand the difference: use `@pytest.mark.skip` or `pytest --ignore` for tests that should not run, and `pytest-ignore-test-results` for tests that must run but whose failures should not break the build.
affects: >=0.1.0
gotchaThe default exit code behavior can be confusing. If tests fail but all failures are ignored by the plugin, `pytest` will typically exit with code 0 (success) unless `--strict-exit-code` is used.
fix
Use the `--strict-exit-code` option if you want `pytest` to exit with a specific non-zero code (e.g., 6) when all actual failures have been ignored by the plugin. This provides a clear signal in CI/CD that issues were present but suppressed.
affects: >=0.1.0
gotchaUsing `--ignore-no-tests-collected` will suppress the `pytest` error when no tests are found and return exit code 0. While useful in specific scenarios, this can mask issues where tests were expected but not collected.
fix
Only use `--ignore-no-tests-collected` when you explicitly expect zero tests in a given run, such as in conditional test environments. Otherwise, investigate why tests are not being collected.
affects: >=0.1.0
Upgrade
Version history
0.3.0latest on PyPI · released Feb 3, 2025
Audit
Dependencies
pytestrequiredCore testing framework. Requires pytest>=7.0.
Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
pytest-ignore-test-results — pip install pytest-ignore-test-results · libregistry