Skip to main content

PyTest Plus Plugin :: extends pytest functionality

Project description

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.

Release process

Releases are triggered from GitHub Releases page.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-plus-0.6.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

pytest_plus-0.6.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest-plus-0.6.1.tar.gz.

File metadata

  • Download URL: pytest-plus-0.6.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for pytest-plus-0.6.1.tar.gz
Algorithm Hash digest
SHA256 d6afc9d08559f6932b4614019149f04d72a44d7b486bdcb1e5ab66ee15fe59c6
MD5 c5002eb1252c7d46c722f525806b0580
BLAKE2b-256 d5d544f87f1e90bc745d86cc3f488230fcf7a45b6575c5aa3acb4fdcf7b327db

See more details on using hashes here.

File details

Details for the file pytest_plus-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_plus-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for pytest_plus-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62cf8af1b370c772299fccb47530767f65d6880f7d36c912573552ec3464a321
MD5 c417608f562baaa80fe5a36102e4e493
BLAKE2b-256 621a828cd585c876be4990298bb0f8aeea2cdde051e00ff3ba75f92ae177c8b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page