pytest-custom-report
raw JSON → 1.0.1 verified Sat May 09 auth: no python maintenance
A pytest plugin to configure the symbols displayed for test outcomes (e.g., . and F). Version 1.0.1 supports pytest 4.2.0+, where xfail was renamed to XFAIL. Low-maintenance library with no recent releases.
pip install pytest-custom-report Common errors
error ModuleNotFoundError: No module named 'pytest_custom_report' ↓
cause Plugin not installed in the current environment.
fix
Run 'pip install pytest-custom-report'
error pytest: error: unrecognized arguments: --custom-report ↓
cause The plugin does not define any command-line flags; configuration is done via the hook function.
fix
Remove any --custom-report arguments and define the pytest_custom_report hook in conftest.py.
error Failed: could not create report: 'PASSED' ↓
cause Return value from pytest_custom_report must be a dict with keys matching the standard outcomes (e.g., 'PASSED', 'FAILED').
fix
Ensure your hook returns a dict with correct outcome keys.
Warnings
breaking Renamed 'xfail' to 'XFAIL' in default output to match pytest v4.2.0. This changes the default symbols for expected failures. ↓
fix If you relied on the old 'xfail' symbol, update your custom report or accept the new default 'XFAIL'.
gotcha The plugin does not support per-test symbols; the hook function receives 'short' and 'long' booleans that determine the detail level, not individual test names. ↓
fix Implement your own per-test logic if needed by inspecting the test item (not directly supported).
deprecated The plugin is not actively maintained; no commits since 2019. It may break with future pytest versions. ↓
fix Consider alternatives like pytest-custom-report or maintaining a fork.
Imports
- pytest
import pytest
Quickstart
# conftest.py
import pytest
def pytest_custom_report(short, long):
# Customize symbols
return {
'PASSED': short and '.' or 'PASS',
'FAILED': short and 'F' or 'FAIL',
}