{"id":1872,"library":"pytest-sugar","title":"pytest-sugar","description":"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.","status":"active","version":"1.1.1","language":"en","source_language":"en","source_url":"https://github.com/Teemu/pytest-sugar","tags":["pytest","testing","plugin","developer-tool","ux-enhancement"],"install":[{"cmd":"pip install pytest-sugar","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"pytest-sugar is a plugin for pytest and requires it to function.","package":"pytest","optional":false}],"imports":[],"quickstart":{"code":"# 1. Install pytest and pytest-sugar\n# pip install pytest pytest-sugar\n\n# 2. Create a test file (e.g., test_example.py)\n# Then run pytest from your terminal in the same directory.\n\n# --- test_example.py ---\nimport time\nimport pytest\n\ndef test_passing_example():\n    assert True\n\ndef test_failing_example():\n    assert False\n\n@pytest.mark.parametrize(\"i\", range(3))\ndef test_parametrized_example(i):\n    time.sleep(0.1) # Simulate some work\n    assert i < 2 # One will fail\n\ndef test_long_running_example():\n    time.sleep(0.5)\n    assert True\n\n# 3. Run tests using pytest (pytest-sugar is automatically enabled):\n#    pytest","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade to Python 3.8 or newer, or downgrade pytest-sugar to <1.0.0 (not recommended).","message":"Python 3.7 support was dropped in pytest-sugar v1.0.0. Ensure your environment uses Python 3.8 or newer.","severity":"breaking","affected_versions":">=1.0.0"},{"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.","message":"pytest-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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Conflicts 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}