skillfed

pytest-custom-exit-code

Exit pytest test session with custom exit code in different scenarios

pytest-custom-exit-code v0.3.0 7.9M downloads/30d#1,688 on PyPI32
Permissive license MIT Abandoned released

What it is and what it does

pytest-custom-exit-code is a pytest plugin that overrides the default exit codes pytest returns at the end of a test session. Normally, pytest exits with specific codes to signal test outcomes (e.g., 1 for failures, 5 for no tests collected). This plugin adds command-line flags to suppress or customize those exit codes in specific scenarios—for instance, to exit with 0 even when tests fail or when no tests are found, which can be useful in CI/CD pipelines where you want to handle test outcomes differently.

The plugin depends only on pytest and installs as a wheel with no compiled dependencies. It is straightforward to use via command-line flags passed to pytest. However, the project has been abandoned since 2020, with no updates to support newer pytest or Python versions, so compatibility with current environments is uncertain.

Use it for:

  • Suppress the exit code when pytest finds no tests, allowing CI pipelines to continue without treating it as a failure.
  • Suppress the exit code when tests fail, so your build system can decide how to handle test failures independently.
  • Integrate pytest into legacy CI/CD systems that expect different exit codes than pytest's defaults.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A pytest plugin that lets you customize the exit code pytest returns when tests fail or when no tests are found, instead of using pytest's default exit codes.

No. The package is abandoned (last update 2020) and compatibility with modern pytest and Python versions is unverified. If you need custom exit code handling, consider whether pytest's native exit codes meet your needs or explore actively maintained alternatives before relying on this plugin.

Install

pytest-custom-exit-code on PyPI

pip

pip install pytest-custom-exit-code

uv

uv add pytest-custom-exit-code

poetry

poetry add pytest-custom-exit-code

Installing pytest-custom-exit-code

Before you install

Low friction to install, but the package is abandoned—last release was in 2019 and last commit in 2020. No recent maintenance or updates.

License in practice

MIT license is permissive; you can use this freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pytest-custom-exit-code

pytest --suppress-no-test-exit-code
pytest --suppress-tests-failed-exit-code

Verify before relying

  • Whether the plugin works with modern pytest versions released after 2020.
  • Whether the two command-line options (suppress-no-test-exit-code, suppress-tests-failed-exit-code) are the only available customizations or if there are others.
  • Whether there are any known incompatibilities with current Python or pytest releases.

Package facts

License MIT (permissive)
Python support supports the current Python release (>2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pytest
Maintenance abandoned — 2,564 days since the last release
Last repo commit
First released
Downloads 7,855,803/month — #1,688 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytest_custom_exit_code-0.3.0-py3-none-any.whl

Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Testing

Tags

pytest exit code customizationpytest custom exit statuspytest suppress no tests exit codepytest failed tests exit codepytest plugin exit handling
pytest-pluginci-cd

More Testing packages

pluggy

Pluggy provides a plugin system that lets you…

permissive · top 100 on PyPI

pytest

pytest is a testing framework that lets you…

permissive · top 100 on PyPI

virtualenv

virtualenv creates isolated Python environments…

permissive · top 100 on PyPI

coverage

Coverage.py measures which lines of Python code…

permissive · top 1,000 on PyPI

pytest-asyncio

pytest-asyncio is a pytest plugin that enables…

permissive · top 1,000 on PyPI

pytest-json-ctrf

A pytest plugin that generates test reports in…

permissive · top 1,000 on PyPI

pytest-error-for-skips

A pytest plugin that converts skipped tests…

permissive · top 15,000 on PyPI

pytest-logging

A pytest plugin that configures Python logging…

permissive · top 15,000 on PyPI

pytest-picked

A pytest plugin that automatically runs only…

permissive · top 5,000 on PyPI

pytest-threadleak

A pytest plugin that detects when tests leak…

permissive · top 15,000 on PyPI

pytest-plus

A pytest plugin that adds optional test-count…

permissive · top 15,000 on PyPI

pytest-ignore-test-results

A pytest plugin that selectively ignores test…

permissive · top 15,000 on PyPI

pytest-deadfixtures

A pytest plugin that identifies unused and…

permissive · top 5,000 on PyPI

pytest-rich

A pytest plugin that uses rich to format and…

permissive · top 15,000 on PyPI

pytest-emoji

Adds emoji indicators to pytest test result…

permissive · top 15,000 on PyPI

exit-codes

Provides platform-independent exit codes for…

permissive · top 15,000 on PyPI