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
  • 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.3.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.3.0
File Size Uploaded
pytest_ignore_test_results-0.3.0.tar.gz 18.4 kB Details

Built distribution (wheel)

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

Total release size: 29.5 kB

Release files / pytest_ignore_test_results-0.3.0.tar.gz

Download URL pytest_ignore_test_results-0.3.0.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0577e2cb35a304bc437044b7367f264faa6a666d99e180590c73c32286e6deaf
BLAKE2b-256 checksum
How to use checksums
9b1277a2d780c7b1b2150790d7545a7104b3bdfe6dcab630ae4e28312bfed018
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

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

Download URL pytest_ignore_test_results-0.3.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8300bc2ff0a4020a88732d34689331b214b3b9b7dbfc436edc3c08ad47cb400
BLAKE2b-256 checksum
How to use checksums
58f76e1937e5fa830e53e3a378b52e7ada4e3b6c28cf7b8564ec3d8b8dc78e01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.2

2 release files

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