Skip to main content

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 of glob patterns used to find files with factoryboy factories declarations starting from the auto_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 of WebSocketCommunicator instances, that will automatically disconnect at the end of a test. Using this fixture also automatically flush all used channel layers
  • http_commmunicator_factory - factory of HttpCommunicator 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 instance
  • api_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

logpass_pytest_plugins-0.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

logpass_pytest_plugins-0.0.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file logpass_pytest_plugins-0.0.2.tar.gz.

File metadata

  • Download URL: logpass_pytest_plugins-0.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.11.0-1027-azure

File hashes

Hashes for logpass_pytest_plugins-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f8cbef09a1b08f6c33a82ed7d397301ba8bc16677b6e9562506137ff6527e12a
MD5 993290eb16df5694ccb13cfb4065f4ce
BLAKE2b-256 dd89fff0eb068cedef4cdee94e9eeffae057daa2d14d5e4b5ff3cee3cce7e045

See more details on using hashes here.

File details

Details for the file logpass_pytest_plugins-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for logpass_pytest_plugins-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fc5ac28a809af76ba99d3ccc6ad0e9a7046a134a7d23645088b5e6022c383e33
MD5 ca41f7fed1500387950a216c897ae3c1
BLAKE2b-256 edab0003ba3638e0f7ba9954e9aae0126bc1bef167998c499e47c8e7c322de28

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