Registry / testing / pytest-sugar

pytest-sugar

JSON →
library1.1.1pypypiunverified

pytest-sugar is a plugin for the pytest testing framework that enhances its default output with a cleaner, more readable progress bar and immediate feedback on failing tests. It is actively maintained, currently at version 1.1.1, and releases new versions to support new pytest features or address compatibility issues.

pip install pytest-sugar
INSTALL
IMPORT
SIG · PYTEST-SUGAR
P
pytest-sugar
testingpythonv1.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Install the library and pytest. Create a simple test file. Run `pytest` from your terminal, and pytest-sugar's enhanced output will be automatically applied. No explicit imports are needed for basic usage.

# 1. Install pytest and pytest-sugar # pip install pytest pytest-sugar # 2. Create a test file (e.g., test_example.py) # Then run pytest from your terminal in the same directory. # --- test_example.py --- import time import pytest def test_passing_example(): assert True def test_failing_example(): assert False @pytest.mark.parametrize("i", range(3)) def test_parametrized_example(i): time.sleep(0.1) # Simulate some work assert i < 2 # One will fail def test_long_running_example(): time.sleep(0.5) assert True # 3. Run tests using pytest (pytest-sugar is automatically enabled): # pytest
pytest --version
Debug
Known issues
breakingPython 3.7 support was dropped in pytest-sugar v1.0.0. Ensure your environment uses Python 3.8 or newer.
fix
Upgrade to Python 3.8 or newer, or downgrade pytest-sugar to <1.0.0 (not recommended).
affects: >=1.0.0
gotchapytest-sugar's compatibility with pytest versions is crucial. Version 1.0.0 added explicit support for pytest 8.x. Always ensure your pytest-sugar version is compatible with your installed pytest version to avoid unexpected behavior.
fix
Check pytest-sugar's `pyproject.toml` or `setup.py` on GitHub for its declared pytest version range and ensure your pytest installation falls within it. Upgrade both if necessary.
affects: All versions
gotchaConflicts with other pytest plugins (especially those modifying terminal output) are possible. While v1.1.1 included adjustments to prevent some conflicts, issues can still arise.
fix
If you experience unexpected behavior, try running pytest with `--no-sugar` to disable the plugin, or temporarily disable other terminal-modifying plugins to identify the conflict source.
affects: All versions
Upgrade
Version history
1.1.1latest on PyPI · released Aug 23, 2025
Audit
Dependencies
pytestrequiredpytest-sugar is a plugin for pytest and requires it to function.
Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
pytest-sugar — pip install pytest-sugar · libregistry