pytest-sugar


Namepytest-sugar JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/Teemu/pytest-sugar
Summarypytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly).
upload_time2025-08-23 12:19:35
maintainerNone
docs_urlNone
authorTeemu, Janne Vanhala and others
requires_pythonNone
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # pytest-sugar ✨

[![Build Status](https://img.shields.io/github/actions/workflow/status/Teemu/pytest-sugar/build-and-test.yaml?branch=main)](https://github.com/Teemu/pytest-sugar/actions)
[![PyPI Version](https://img.shields.io/pypi/v/pytest-sugar.svg)](https://pypi.org/project/pytest-sugar/)
[![Downloads](https://img.shields.io/pypi/dm/pytest-sugar)](https://pypi.org/project/pytest-sugar/)
![License](https://img.shields.io/pypi/l/pytest-sugar?color=blue)

This plugin extends [pytest](http://pytest.org) by showing failures and errors instantly, adding a progress bar, improving the test results, and making the output look better.

![render1667890332624-min](https://user-images.githubusercontent.com/53298/200600769-7b871b26-a36a-4ae6-ae24-945ee83fb74a.gif)

## Installation

To install pytest-sugar:

    python -m pip install pytest-sugar

Once installed, the plugin is activated automatically. Run your tests normally:

    pytest

If you would like more detailed output (one test per line), then you may use the verbose option:

    pytest --verbose

If you would like to run tests without pytest-sugar, use:

    pytest -p no:sugar

## Usage
pytest-sugar provides several command-line options to customize its output and behavior. These options enhance test reporting and Playwright trace integration:


Show detailed test failures instead of one-line tracebacks.
Use this if you want to see the full failure information instantly.

    --old-summary

Force pytest-sugar output even if pytest doesn’t detect a real terminal.
Useful when running tests in CI systems or other non-interactive environments.

    --force-sugar


Specify the directory where Playwright trace files are stored.
Defaults to Playwright default: "test-results"

    --sugar-trace-dir <directory>

Disable Playwright trace file detection and output display.
Use this if you want to turn off trace collection or display entirely.

    --sugar-no-trace


## How to contribute 👷‍♂️

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=master&repo=10950375)

Make sure to read our [Code of Conduct](https://github.com/Teemu/pytest-sugar/blob/master/.github/CODE_OF_CONDUCT.md). You can get started modifying the codebase with the following commands. Alternatively, you can try Github Codespaces (click the badge above). Push the changes to your repository & create a pull request.

````
git clone git@github.com:Teemu/pytest-sugar.git
cd pytest-sugar
python -m venv .venv
source .venv/bin/activate
echo ".venv" >> .git/info/exclude
pip install -e ".[dev]"
pre-commit install
````

There are two ways of running tests. We have our proper tests:

````
pytest .
````

There are also fake tests that can be used to visualise the output:

````
pytest faketests
````

When submitting a pull request, please add a `RELEASE.md` file in the root of the project that contains the release type (major, minor, patch) and a summary of the changes that will be used as the release changelog entry. For example:

```markdown
Release type: patch

For long-running tests, display minutes and not only seconds.
```

## Requirements

You will need the following prerequisites in order to use pytest-sugar:

- Python 3.8 or newer
- pytest 6.2 or newer

## Running on Windows

If you are seeing gibberish, you might want to try changing charset and fonts. See [this comment]( https://github.com/Teemu/pytest-sugar/pull/49#issuecomment-146567670) for more details.

## Similar projects

- [pytest-rich](https://github.com/nicoddemus/pytest-rich)
- [pytest-pretty](https://github.com/samuelcolvin/pytest-pretty)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Teemu/pytest-sugar",
    "name": "pytest-sugar",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Teemu, Janne Vanhala and others",
    "author_email": "orkkiolento@gmail.com, janne.vanhala@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/4e/60fed105549297ba1a700e1ea7b828044842ea27d72c898990510b79b0e2/pytest-sugar-1.1.1.tar.gz",
    "platform": "any",
    "description": "# pytest-sugar \u2728\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/Teemu/pytest-sugar/build-and-test.yaml?branch=main)](https://github.com/Teemu/pytest-sugar/actions)\n[![PyPI Version](https://img.shields.io/pypi/v/pytest-sugar.svg)](https://pypi.org/project/pytest-sugar/)\n[![Downloads](https://img.shields.io/pypi/dm/pytest-sugar)](https://pypi.org/project/pytest-sugar/)\n![License](https://img.shields.io/pypi/l/pytest-sugar?color=blue)\n\nThis plugin extends [pytest](http://pytest.org) by showing failures and errors instantly, adding a progress bar, improving the test results, and making the output look better.\n\n![render1667890332624-min](https://user-images.githubusercontent.com/53298/200600769-7b871b26-a36a-4ae6-ae24-945ee83fb74a.gif)\n\n## Installation\n\nTo install pytest-sugar:\n\n    python -m pip install pytest-sugar\n\nOnce installed, the plugin is activated automatically. Run your tests normally:\n\n    pytest\n\nIf you would like more detailed output (one test per line), then you may use the verbose option:\n\n    pytest --verbose\n\nIf you would like to run tests without pytest-sugar, use:\n\n    pytest -p no:sugar\n\n## Usage\npytest-sugar provides several command-line options to customize its output and behavior. These options enhance test reporting and Playwright trace integration:\n\n\nShow detailed test failures instead of one-line tracebacks.\nUse this if you want to see the full failure information instantly.\n\n    --old-summary\n\nForce pytest-sugar output even if pytest doesn\u2019t detect a real terminal.\nUseful when running tests in CI systems or other non-interactive environments.\n\n    --force-sugar\n\n\nSpecify the directory where Playwright trace files are stored.\nDefaults to Playwright default: \"test-results\"\n\n    --sugar-trace-dir <directory>\n\nDisable Playwright trace file detection and output display.\nUse this if you want to turn off trace collection or display entirely.\n\n    --sugar-no-trace\n\n\n## How to contribute \ud83d\udc77\u200d\u2642\ufe0f\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=master&repo=10950375)\n\nMake sure to read our [Code of Conduct](https://github.com/Teemu/pytest-sugar/blob/master/.github/CODE_OF_CONDUCT.md). You can get started modifying the codebase with the following commands. Alternatively, you can try Github Codespaces (click the badge above). Push the changes to your repository & create a pull request.\n\n````\ngit clone git@github.com:Teemu/pytest-sugar.git\ncd pytest-sugar\npython -m venv .venv\nsource .venv/bin/activate\necho \".venv\" >> .git/info/exclude\npip install -e \".[dev]\"\npre-commit install\n````\n\nThere are two ways of running tests. We have our proper tests:\n\n````\npytest .\n````\n\nThere are also fake tests that can be used to visualise the output:\n\n````\npytest faketests\n````\n\nWhen submitting a pull request, please add a `RELEASE.md` file in the root of the project that contains the release type (major, minor, patch) and a summary of the changes that will be used as the release changelog entry. For example:\n\n```markdown\nRelease type: patch\n\nFor long-running tests, display minutes and not only seconds.\n```\n\n## Requirements\n\nYou will need the following prerequisites in order to use pytest-sugar:\n\n- Python 3.8 or newer\n- pytest 6.2 or newer\n\n## Running on Windows\n\nIf you are seeing gibberish, you might want to try changing charset and fonts. See [this comment]( https://github.com/Teemu/pytest-sugar/pull/49#issuecomment-146567670) for more details.\n\n## Similar projects\n\n- [pytest-rich](https://github.com/nicoddemus/pytest-rich)\n- [pytest-pretty](https://github.com/samuelcolvin/pytest-pretty)\n\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly).",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/Teemu/pytest-sugar",
        "Issue Tracker": "https://github.com/Teemu/pytest-sugar/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "87d581d38a91c1fdafb6711f053f5a9b92ff788013b19821257c2c38c1e132df",
                "md5": "552fbdf7c12530ba2bc9569458068124",
                "sha256": "2f8319b907548d5b9d03a171515c1d43d2e38e32bd8182a1781eb20b43344cc8"
            },
            "downloads": -1,
            "filename": "pytest_sugar-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "552fbdf7c12530ba2bc9569458068124",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11440,
            "upload_time": "2025-08-23T12:19:34",
            "upload_time_iso_8601": "2025-08-23T12:19:34.894969Z",
            "url": "https://files.pythonhosted.org/packages/87/d5/81d38a91c1fdafb6711f053f5a9b92ff788013b19821257c2c38c1e132df/pytest_sugar-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0b4e60fed105549297ba1a700e1ea7b828044842ea27d72c898990510b79b0e2",
                "md5": "1fc48113dd93355946577114a7fa3d82",
                "sha256": "73b8b65163ebf10f9f671efab9eed3d56f20d2ca68bda83fa64740a92c08f65d"
            },
            "downloads": -1,
            "filename": "pytest-sugar-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1fc48113dd93355946577114a7fa3d82",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16533,
            "upload_time": "2025-08-23T12:19:35",
            "upload_time_iso_8601": "2025-08-23T12:19:35.737655Z",
            "url": "https://files.pythonhosted.org/packages/0b/4e/60fed105549297ba1a700e1ea7b828044842ea27d72c898990510b79b0e2/pytest-sugar-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-23 12:19:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Teemu",
    "github_project": "pytest-sugar",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "pytest-sugar"
}
        
Elapsed time: 1.82407s