Skip to main content

A plugin to pytest stoq

Project description

PyPI version Python versions CI Build

A plugin to pytest stoq.

This plugin automatically set up the stoq test environment. It also provide a range of fixtures to ease the testing of stoq-related projects.

Installation

You can install “pytest-stoq” via pip from PyPI:

$ pip install pytest-stoq

Command-line options

  • --plugin-cls: the plugin class path to be installed. Useful for testing stoq plugin projects.

  • --quick: setup stoq using the quick strategy.

  • --skip-env-setup: pytest-stoq won’t setup the database, install plugins etc. (in case you already have the test env ready).

  • --stoq-plugins: a comma-separated list of stoq plugin names to be installed. Useful for testing stoq applications that uses plugins (such as stoq desktop and stoq server).

Config file options

  • PLUGIN_CLASS: same as --plugin-cls

  • STOQ_PLUGINS: same as --stoq-plugins

Fixtures

The plugin provides the following fixtures:

  • store: an instance of storm’s (ORM) store used to access the database. It suffers rollback after each test case and cannot be committed, closed or rollbacked manually

  • example_creator: instance creates (inserts) database objects with example/test data

  • sysparam: a sysparam instance that clear its cache automatically after each use

  • current_station

  • current_user

  • current_branch

  • current_till

  • mock_new_store: replace stoqlib.api.new_store() with the store fixture

Local Development

(optional) Setup your virtualenv using python 3.5+

Install test requirements:

$ pip install -Ur requirements-test.txt

Setup pre-commit:

$ pre-commit install

Run tests using pytest:

$ make test

License

Distributed under the terms of the GNU GPL v3.0 license, “pytest-stoq” is free and open source software

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

pytest-stoq-0.7.0.tar.gz (16.4 kB view details)

Uploaded Source

File details

Details for the file pytest-stoq-0.7.0.tar.gz.

File metadata

  • Download URL: pytest-stoq-0.7.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4

File hashes

Hashes for pytest-stoq-0.7.0.tar.gz
Algorithm Hash digest
SHA256 5c5a78cc1e7144ceed10c312b0939ca6693dd0b566c559a7184f5047c9e5d60d
MD5 9f2518dfdd51da76a2f1cfcff39c83eb
BLAKE2b-256 76f17cb1ab2a8e8006fc4dadc2177c6f611322aaab97bf7d5512ba93e1a626d9

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