Skip to main content
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

Metadata

Release files for pytest-stoq 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-stoq 0.7.2
File Size Uploaded
pytest-stoq-0.7.2.tar.gz 16.9 kB Details

Release files / pytest-stoq-0.7.2.tar.gz

Download URL pytest-stoq-0.7.2.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
756a61a2ec0c1d57681eb783bf67fab735d26192f64dc9a0f0b902bccac53252
BLAKE2b-256 checksum
How to use checksums
0737f731a56d6d0cc0deb2b75020e5c03c012597f1a291129943844f17f847cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.7.2 This release

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page