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.5.tar.gz
.
File metadata
- Download URL: logpass_pytest_plugins-0.0.5.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.5 Linux/5.13.0-1029-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c789210047fb78bed7999a793d9989dae1fb60da32d3784f5401201c8fb8993d |
|
MD5 | 1b503546bafe4e6a1d1cdefb9bafcde3 |
|
BLAKE2b-256 | 0455305ce97a11792dd4dd42f5ee0019cb47e1770606ea7eb7cdf523b605d307 |
File details
Details for the file logpass_pytest_plugins-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: logpass_pytest_plugins-0.0.5-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.5 Linux/5.13.0-1029-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c138f0d61e877cbfec7d2f0e859c2b166f8c8f38200840921ded087dd37d665 |
|
MD5 | c032562dd6f0143e5d78bf4788115950 |
|
BLAKE2b-256 | 54c4b255f6b5ecb97e8eeda41ba6a3ec710f7093a452f00a6a55c19a1883733a |