Skip to main content

PyTest Plus Plugin :: extends pytest functionality

PyPI version Python versions CI Python Black Code Style

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:

- 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 page.

Links

Metadata

Release files for pytest-plus 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-plus 0.8.1
File Size Uploaded
pytest_plus-0.8.1.tar.gz 15.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-plus 0.8.1
File Interpreter ABI Platform
pytest_plus-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.7 kB

Release files / pytest_plus-0.8.1.tar.gz

Download URL pytest_plus-0.8.1.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
02dfb28f1a914e8df3b6e3525df7e94feabc0681ecea626912e8028e9355f02c
BLAKE2b-256 checksum
How to use checksums
838dc5acdd43847e975b31173f12fe3660174fb4f274f5bbe0b7efb5fa5d91fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 2, 2025.

Transparency log

Release files / pytest_plus-0.8.1-py3-none-any.whl

Download URL pytest_plus-0.8.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b8e9037716c9d7b708074863933897681f86d852d9c4e9717271be143dbdfb6
BLAKE2b-256 checksum
How to use checksums
12ae35aac382af0d72c57df397deb753bca71a879a0a51f52b3ce77b3d2e7643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 2, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page