{"id":8534,"library":"pytest-ignore-test-results","title":"pytest-ignore-test-results","description":"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.","status":"active","version":"0.3.0","language":"python","source_language":"en","source_url":"https://github.com/espressif/pytest-ignore-test-results.git","tags":["pytest","testing","ci","test-results","plugin","continuous-integration"],"install":[{"cmd":"pip install -U pytest-ignore-test-results","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core testing framework. Requires pytest>=7.0.","package":"pytest","optional":false}],"imports":[{"note":"The plugin auto-registers with pytest upon installation. There are no common user-facing imports for its core ignoring mechanism.","symbol":"pytest_ignore_test_results","correct":"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."}],"quickstart":{"code":"# First, ensure you have pytest and the plugin installed:\n# pip install pytest pytest-ignore-test-results\n\n# Create a test file (e.g., test_example.py)\n# ----------------------------------------\n# def test_passing():\n#     assert True\n#\n# def test_failing_critical():\n#     assert False, \"This test MUST NOT be ignored\"\n#\n# def test_failing_but_ignorable():\n#     assert False, \"This test's failure can be ignored\"\n# ----------------------------------------\n\n# Run pytest, ignoring the result of 'test_failing_but_ignorable':\n# The test will still run, but its failure won't cause pytest to exit with a non-zero code\n# unless --strict-exit-code is used and ALL failures are ignored.\n# Expected output will show 'xfailed' or 'ignored' for the specified test.\n\nprint(\"Run with: pytest --ignore-result-cases 'test_failing_but_ignorable' test_example.py\")\n# Example of ignoring tests based on a pattern:\nprint(\"Run with: pytest --ignore-result-cases 'test_failing_*' test_example.py\")\n\n# Example of loading ignore patterns from a file (e.g., ignore_list.txt):\n# Content of ignore_list.txt:\n# test_failing_but_ignorable\n# test_feature_*\nprint(\"Run with: pytest --ignore-result-files ignore_list.txt test_example.py\")\n\n# To exit with code 6 if all failed tests are ignored:\nprint(\"Run with: pytest --ignore-result-cases 'test_failing_but_ignorable' --strict-exit-code test_example.py\")\n","lang":"python","description":"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."},"warnings":[{"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.","message":"This 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"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.","message":"Using `--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.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.3.0':54 'activ':58 'allow':26 'case':31 'ci':74 'code':47 'continu':80 'continuous-integr':79 'current':51 'enabl':16 'espressif':61 'execut':24 'exit':46 'failur':37 'featur':71 'ignor':3,8,20 'integr':81 'maintain':22,59 'name':33 'need':66 'new':70 'non':44 'non-zero':43 'occur':64 'pattern':35 'plugin':14,78 'pytest':2,7,13,49,72 'pytest-ignore-test-result':1,6 'releas':63 'result':5,10,19,40,77 'select':17 'specifi':29 'test':4,9,18,23,30,73,76 'test-result':75 'updat':68 'user':27 'version':52 'whose':36 'zero':45","created_at":"2026-04-16T17:02:41.240579+00:00","updated_at":"2026-04-16T17:02:41.240579+00:00","problems":{"verify_error":"no import statement found"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.3.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/espressif/pytest-ignore-test-results","docs":null,"changelog":"https://github.com/espressif/pytest-ignore-test-results/blob/main/CHANGELOG.md","pypi":"https://pypi.org/project/pytest-ignore-test-results/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}