pytest-plus


Namepytest-plus JSON
Version 0.7.0 PyPI version JSON
download
home_pageNone
SummaryPyTest Plus Plugin :: extends pytest functionality
upload_time2024-03-26 17:00:28
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords testing pytest plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyTest Plus Plugin :: extends pytest functionality

[![PyPI version](https://img.shields.io/pypi/v/pytest-plus.svg)](https://pypi.org/project/pytest-plus)
[![Python versions](https://img.shields.io/pypi/pyversions/pytest-plus.svg)](https://pypi.org/project/pytest-plus)
![CI](https://github.com/pytest-dev/pytest-plus/workflows/tox/badge.svg)
[![Python Black Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)

This plugin aims to be used to host multiple basic pytest extensions that meet
the following criteria:

- Downgrade gracefully, meaning that if the plugin is removed, you will still
  be able to run pytest

## PYTEST_REQPASS

If you define environment variable `PYTEST_REQPASS=123` and at the end of the
testing the number of passed tests is
not exactly 123, pytest will return exit code 1.

This feature is aimed for CI usage in order to prevent accidental skipping of
some tests. We do expect users to define this variable within their own CI job
definitions. The number of tests executed is likely to be dependent on the CI
job.

We discourage defining this inside places like `tox.ini` because when a
developer runs tests, they are likely to endup running a different number of
tests. Also, this feature makes no sense if you try to mention a specific test.

## Avoiding duplicate test function names

While pytest allows users to have the same test function names in different
files, that makes it harder to identify and copy/paste the test name in order
to reproduce the failure locally. That is why this plugin forces its users to
avoid having the same function name anywhere in the tested project.

You can disable this check by defining `PYTEST_CHECK_TEST_DUPLICATE=0`.

## Avoiding problematic test identifiers

This plugin will raise errors when it encounters test IDs that are either too
long or that contain unsafe characters. While pytest is very flexible in allowing
a wide range of test IDs, using these does make development harder as it prevents
people from doing a copy/paste with failed test and pasting in in their terminal
to reproduce the failed test locally.

You can disable regex check by defining `PYTEST_CHECK_TEST_ID_REGEX=0`.

You can disable the length check by defining `PYTEST_MAX_TEST_ID_LENGTH=0`.

## Prepare pytest log files for collection on CI

As pytest log files are created on temp directory and some CI systems refuse
to collect files from outside the current project, we do copy these files inside
`$VIRTUAL_ENV/log`, same directory used by tox itself. To collect the logs on
Github Actions, you only need a step like:

```yaml
- name: Archive logs
  uses: actions/upload-artifact@v4
  with:
    name: logs-${{ matrix.name }}.zip
    path: .tox/**/log/
```

## Release process

Releases are triggered from [GitHub Releases](https://github.com/pytest-dev/pytest-plus/releases)
page.

## Links

- [MIT](http://opensource.org/licenses/MIT)
- [file an issue](https://github.com/pytest-dev/pytest-plus/issues)
- [pytest](https://github.com/pytest-dev/pytest)
- [tox](https://tox.readthedocs.io/en/latest/)
- [pip](https://pypi.org/project/pip/)
- [PyPI](https://pypi.org/project)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytest-plus",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Sorin Sbarnea <sorin.sbarnea@gmail.com>",
    "keywords": "testing, pytest, plugin",
    "author": null,
    "author_email": "Sorin Sbarnea <sorin.sbarnea@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/dd/34/bd98b0ed6f3f35b583b5c57dfa1d9a3c21a8a2e7deb57756867a4eaf9e50/pytest-plus-0.7.0.tar.gz",
    "platform": null,
    "description": "# PyTest Plus Plugin :: extends pytest functionality\n\n[![PyPI version](https://img.shields.io/pypi/v/pytest-plus.svg)](https://pypi.org/project/pytest-plus)\n[![Python versions](https://img.shields.io/pypi/pyversions/pytest-plus.svg)](https://pypi.org/project/pytest-plus)\n![CI](https://github.com/pytest-dev/pytest-plus/workflows/tox/badge.svg)\n[![Python Black Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)\n\nThis plugin aims to be used to host multiple basic pytest extensions that meet\nthe following criteria:\n\n- Downgrade gracefully, meaning that if the plugin is removed, you will still\n  be able to run pytest\n\n## PYTEST_REQPASS\n\nIf you define environment variable `PYTEST_REQPASS=123` and at the end of the\ntesting the number of passed tests is\nnot exactly 123, pytest will return exit code 1.\n\nThis feature is aimed for CI usage in order to prevent accidental skipping of\nsome tests. We do expect users to define this variable within their own CI job\ndefinitions. The number of tests executed is likely to be dependent on the CI\njob.\n\nWe discourage defining this inside places like `tox.ini` because when a\ndeveloper runs tests, they are likely to endup running a different number of\ntests. Also, this feature makes no sense if you try to mention a specific test.\n\n## Avoiding duplicate test function names\n\nWhile pytest allows users to have the same test function names in different\nfiles, that makes it harder to identify and copy/paste the test name in order\nto reproduce the failure locally. That is why this plugin forces its users to\navoid having the same function name anywhere in the tested project.\n\nYou can disable this check by defining `PYTEST_CHECK_TEST_DUPLICATE=0`.\n\n## Avoiding problematic test identifiers\n\nThis plugin will raise errors when it encounters test IDs that are either too\nlong or that contain unsafe characters. While pytest is very flexible in allowing\na wide range of test IDs, using these does make development harder as it prevents\npeople from doing a copy/paste with failed test and pasting in in their terminal\nto reproduce the failed test locally.\n\nYou can disable regex check by defining `PYTEST_CHECK_TEST_ID_REGEX=0`.\n\nYou can disable the length check by defining `PYTEST_MAX_TEST_ID_LENGTH=0`.\n\n## Prepare pytest log files for collection on CI\n\nAs pytest log files are created on temp directory and some CI systems refuse\nto collect files from outside the current project, we do copy these files inside\n`$VIRTUAL_ENV/log`, same directory used by tox itself. To collect the logs on\nGithub Actions, you only need a step like:\n\n```yaml\n- name: Archive logs\n  uses: actions/upload-artifact@v4\n  with:\n    name: logs-${{ matrix.name }}.zip\n    path: .tox/**/log/\n```\n\n## Release process\n\nReleases are triggered from [GitHub Releases](https://github.com/pytest-dev/pytest-plus/releases)\npage.\n\n## Links\n\n- [MIT](http://opensource.org/licenses/MIT)\n- [file an issue](https://github.com/pytest-dev/pytest-plus/issues)\n- [pytest](https://github.com/pytest-dev/pytest)\n- [tox](https://tox.readthedocs.io/en/latest/)\n- [pip](https://pypi.org/project/pip/)\n- [PyPI](https://pypi.org/project)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "PyTest Plus Plugin :: extends pytest functionality",
    "version": "0.7.0",
    "project_urls": {
        "changelog": "https://github.com/pytest-dev/pytest-plus/releases",
        "homepage": "https://github.com/pytest-dev/pytest-plus",
        "repository": "https://github.com/pytest-dev/pytest-plus"
    },
    "split_keywords": [
        "testing",
        " pytest",
        " plugin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "458fcce3979d5a9dc85348d55d2c2ead7a12b269cefcf021cf1e2fd5b6d77e6b",
                "md5": "f36b0b132585046a8302fb7c68da8cb6",
                "sha256": "9d5a98ebfb83be4a73543af19e656917dc6f067e417df6a4afbe41e73ea47723"
            },
            "downloads": -1,
            "filename": "pytest_plus-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f36b0b132585046a8302fb7c68da8cb6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6181,
            "upload_time": "2024-03-26T17:00:24",
            "upload_time_iso_8601": "2024-03-26T17:00:24.007204Z",
            "url": "https://files.pythonhosted.org/packages/45/8f/cce3979d5a9dc85348d55d2c2ead7a12b269cefcf021cf1e2fd5b6d77e6b/pytest_plus-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd34bd98b0ed6f3f35b583b5c57dfa1d9a3c21a8a2e7deb57756867a4eaf9e50",
                "md5": "9ed10cc25216c1a5892ae67f814c8591",
                "sha256": "4e958161332d46dab8a2ce5f354e4c5e79508984b66605c5e789bf1220f1c669"
            },
            "downloads": -1,
            "filename": "pytest-plus-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9ed10cc25216c1a5892ae67f814c8591",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 13235,
            "upload_time": "2024-03-26T17:00:28",
            "upload_time_iso_8601": "2024-03-26T17:00:28.441930Z",
            "url": "https://files.pythonhosted.org/packages/dd/34/bd98b0ed6f3f35b583b5c57dfa1d9a3c21a8a2e7deb57756867a4eaf9e50/pytest-plus-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-26 17:00:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pytest-dev",
    "github_project": "pytest-plus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "pytest-plus"
}
        
Elapsed time: 1.04132s