pytest plugin providing a function to check if pytest is running.
Project description
pytest plugin providing a function to check if pytest is running.
Installation
Install with:
python -m pip install pytest-is-running
Python 3.6 to 3.10 supported.
Testing a Django project? Check out my book Speed Up Your Django Tests which covers loads of best practices so you can write faster, more accurate tests.
Usage
pytest will automatically find the plugin and use it when you run pytest. You can check if pytest is running with the is_running() function:
import pytest_is_running
if pytest_is_running.is_running():
...
The package avoids importing pytest if it is not running, so that you don’t incur that overhead in non-test paths.
The package registers its plugin hooks as early as possible in pytest’s process, so it should be loaded before any of your non-test modules.
Rationale
This plugin is an alternative to re-implementing the pattern in the Pytest documentation. As a plugin, it is loaded earlier than conftest.py or any other code in your project. This makes it a more robust way of checking whether Pytest is currently running.
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
Built Distribution
Hashes for pytest_is_running-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6af716d5baea4e12808e2c2dc7569bc47fda8a3da4a89e045939f0e653e1abd |
|
MD5 | 5654adea81f130a90433ea44479150d6 |
|
BLAKE2b-256 | 3fd10175e50dda2d2804aff588c2e432b5d64e208de4d203ca691296c64c2437 |