Skip to main content

pytest-ignore-test-results

A pytest plugin that enables selective test result ignoring while maintaining test execution.

Installation

pip install -U pytest-ignore-test-results

Features

  • Ignore specific test case results using exact names or patterns
  • Load ignore patterns from files
  • Custom exit codes for different failure scenarios
  • Support for child test cases
  • Mark ignored JUnit failures and errors with is_ignored="1"
  • Option to ignore "no tests collected" errors

Usage

Ignore Test Results by Case Name or Pattern

When using this plugin, test cases will execute normally but their results can be selectively ignored. You have two options for specifying which test results to ignore:

  1. Using exact names or patterns directly:
pytest --ignore-result-cases "test_feature_1" "test_feature_2"
pytest --ignore-result-cases "test_feature_*" "test_integration_*"
  1. Specifying patterns in files:
pytest --ignore-result-files ignore_list.txt another_list.txt

Example ignore file content (ignore_list.txt):

test_feature_1  # This is a comment
test_feature_*
test_integration_suite::test_case_1

Control Exit Codes

The plugin provides fine-grained control over exit codes through two options:

  1. --strict-exit-code: When enabled, the plugin will return exit code 6 if all failed test cases are ignored. Otherwise, it maintains pytest's original exit code behavior.
pytest --ignore-result-cases "test_feature_*" --strict-exit-code
  1. --ignore-no-tests-collected: When enabled, this option suppresses "no tests collected" errors and returns exit code 0.
pytest --ignore-no-tests-collected

Custom Test Case Names

The plugin supports test case name customization through the pytest_custom_test_case_name hook:

def pytest_custom_test_case_name(item):
    """
    Args:
        item: pytest item

    Returns:
        str: Custom name for the test case
    """
    return f"custom_name::{item.name}"

Metadata

Release files for pytest-ignore-test-results 0.4.0

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-ignore-test-results 0.4.0
File Size Uploaded Provenance Actions
pytest_ignore_test_results-0.4.0.tar.gz 9.6 kB Without provenance Details for pytest_ignore_test_results-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-ignore-test-results 0.4.0
File Interpreter ABI Platform Actions
pytest_ignore_test_results-0.4.0-py3-none-any.whl Python 3 none any Details for pytest_ignore_test_results-0.4.0-py3-none-any.whl

Total release size: 21.2 kB

Release files / pytest_ignore_test_results-0.4.0.tar.gz

Download URL pytest_ignore_test_results-0.4.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
db5d20f2fa2a399497b79c2e27882dc9776e7a3f50c6b737d10c2296e699e6ff
BLAKE2b-256 checksum
How to use checksums
dd15085c115d89806077fb20b137f43d6ccd6dff29d3669897f4c2e232373354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pytest_ignore_test_results-0.4.0-py3-none-any.whl

Download URL pytest_ignore_test_results-0.4.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3160d19d3f1c5aa83ba70a1b118edd5e0314252b944c94ac73c208dccb39935
BLAKE2b-256 checksum
How to use checksums
913dcb552ba3bf37943afd6f0477eb0e138ba9b621385b9d1370c73376941cdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pytest-ignore-test-results 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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