LogPass pytest plugins
A few pytest plugins used by LogPass.
Installation
To use logpass_pytest_plugins install it with your package manager,
e.g. via pip:
pip install logpass_pytest_plugins
To install plugin with all its dependencies use one of following extras:
auto_pytest_factoryboychannelsrest_framework
For instance, to install channels and rest_framework plugins with all
dependencies:
pip install logpass_pytest_plugins[channels,rest_framework]
And finally add plugin import path to pytest_plugins in your root
conftest.py file, e.g. to use channels and rest_framework plugins:
# root `conftest.py`
pytest_plugins = (
'logpass_pytest_plugins.contrib.channels',
'logpass_pytest_plugins.contrib.rest_framework',
)
Available plugins
NOTE: None plugin is not used by default - you need to enable them via pytest_plugins
logpass_pytest_plugins.contrib.auto_pytest_factoryboy
Plugin that automatically registers factory_boy factories to
pytest-factoryboy, so factories and models instances will be available
as pytest fixtures.
Configuration
Following INI options can be used to configure auto_pytest_factoryboy plugin:
auto_pytest_factoryboy_root_dir- directory where factories declarations searching starts (defaults to.- pytest config path)auto_pytest_factoryboy_globs- list ofglobpatterns used to find files withfactoryboyfactories declarations starting from theauto_pytest_factoryboy_root_dirdirectory (defaults to**/factories*.py)
logpass_pytest_plugins.contrib.channels
Plugin that simplifies channels consumers testing by providing following
fixtures:
websocket_commmunicator_factory- factory ofWebSocketCommunicatorinstances, that will automatically disconnect at the end of a test. Using this fixture also automatically flush all used channel layershttp_commmunicator_factory- factory ofHttpCommunicatorinstances. Using this fixture also automatically flush all used channel layers
logpass_pytest_plugins.contrib.flask
Plugin that simplifies flask views and other components testing
by providing following fixtures:
flask_app-Flaskapp instanceclient-FlaskClientinstance to use in tests
Following INI options can be used to configure flask plugin:
FLASK_SETTINGS_MODULE- import path to settings module when using flask's config from object. OverridesFLASK_SETTINGS_MODULEenvironment variable.FLASK_APP- import path to flask app factory or flask app instance. OverridesFLASK_APPenvironment variable.
To use flask plugin you need to do one of following:
- set
FLASK_APPINI option - set
FLASK_APPenvironment variable - define
flask_appfunction-scoped fixture in rootconftest.py
logpass_pytest_plugins.contrib.rest_framework
Plugin that simplifies rest_framework views and other components testing
by providing following fixtures:
api_rf-APIRequestFactoryinstanceapi_client-APIClientinstance
Metadata
Release files for logpass-pytest-plugins 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| logpass_pytest_plugins-0.1.1.tar.gz | 6.5 kB | Without provenance | Details for logpass_pytest_plugins-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| logpass_pytest_plugins-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for logpass_pytest_plugins-0.1.1-py3-none-any.whl |
Total release size: 13.7 kB
Release files / logpass_pytest_plugins-0.1.1.tar.gz
| Download URL | logpass_pytest_plugins-0.1.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
48350a834f44d8d2cf7bfc97d761997fd5d3a73ef8d88a1e99a8c721f77401d0
|
|
BLAKE2b-256 checksum How to use checksums |
730cab2911fcd3b5a03976607f8f03024db3a3625e8f28ebc98a1b2c4bc11c92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.5 Linux/5.13.0-1031-azure
|
Release files / logpass_pytest_plugins-0.1.1-py3-none-any.whl
| Download URL | logpass_pytest_plugins-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61a169c466e8b2c83a94029530a13e7c7d0764b6eb96b94f8a31e7b2d93646bd
|
|
BLAKE2b-256 checksum How to use checksums |
34b71371712f4d00bd3776f38c967aa170caecd98c4e6548cd8fce8971b37db1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.5 Linux/5.13.0-1031-azure
|
Security for logpass-pytest-plugins 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.