Pytest's plugins crafted by LogPass
Project description
LogPass pytest plugins
A few pytest plugins used by LogPass.
Installation
To use logpass_pytest_plugins
simply 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_factoryboy
channels
rest_framework
For instance, to install channels
and rest_framework
plugins with all
dependencies:
pip install logpass_pytest_plugins[channels,rest_framework]
Available plugins
All plugins are used by default (that's default pytest
behaviour).
If you don't need some plugin (e.g. you don't use djangorestframework
)
simply disable it for particular command call:
pytest -p no:rest_framework
or do it in pytest.ini
(or other file with pytest
configuration):
[pytest]
addopts = -p no:rest_framework
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 ofglob
patterns used to find files withfactoryboy
factories declarations starting from theauto_pytest_factoryboy_root_dir
directory (defaults to**/factories*.py
)
logpass_pytest_plugins.contrib.channels
Plugin that simplifies channels
consumers testing by providing following
fixtures:
websocket_commmunicator_factory
- factory ofWebSocketCommunicator
instances, that will automatically disconnect at the end of a test. Using this fixture also automatically flush all used channel layershttp_commmunicator_factory
- factory ofHttpCommunicator
instances. Using this fixture also automatically flush all used channel layers
logpass_pytest_plugins.contrib.rest_framework
Plugin that simplifies rest_framework
views and other components testing
by providing following fixtures:
api_rf
-APIRequestFactory
instanceapi_client
-APIClient
instance
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
File details
Details for the file logpass_pytest_plugins-0.0.4.tar.gz
.
File metadata
- Download URL: logpass_pytest_plugins-0.0.4.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 865da89b28af0f6f8f4b0433c07ba7ec67aa44d99f3f73c3c277521066fb2c53 |
|
MD5 | 68f849f96d9ab01ba946fd3a1bef16c5 |
|
BLAKE2b-256 | bbd2122043b6e3090f62e889d789d4e274a0c70b1916890c9490cd086e650c17 |
File details
Details for the file logpass_pytest_plugins-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: logpass_pytest_plugins-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e38795e5a79468cb6bcf867931d9ec1c92cc6304636f45da7092c9d2601242f |
|
MD5 | 39cf0666e9b16b3002eb9d75b5f9e22a |
|
BLAKE2b-256 | ea2b63fbc6216c95d4f76e863e5fae570202d7af5a96f1fe417b41645e9126e1 |