Expand command-line shortcuts listed in pytest configuration
Project description
pytest-shortcuts
Expand command-line shortcuts listed in pytest configuration
This pytest plugin was generated with Cookiecutter along with @hackebrot's cookiecutter-pytest-plugin template.
Getting Started
Install using your favourite python package manager:
$ pip install pytest-shortcuts
Add some shortcuts to your pytest configuration:
[pytest]
shortcuts =
--live: -m "live and not slow"
--slow: -m "live and slow"
--offline: --disable-socket -m "not live"
Now when you run your tests with eg --live
, it will be as if you provided -m "live and not slow"
.
Bonus: including dotenv files
For each shortcut, you can also define a dotenv file to load with custom configuration:
[pytest]
shortcuts =
--live: -m "live and not slow" --envfile=.live.env
--slow: -m "live and slow"
Note that this dotenv file loads the environment very early, but any pytest-plugins will have already been imported by then. Any plugin that relies on an environment variable during module import (and not eg at runtime) may not see values loaded from this file.
License
Distributed under the terms of the BSD-3 license, "pytest-shortcuts" 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
Built Distribution
Hashes for pytest_shortcuts-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44c5278c6ed615c820c84bb14af86452745793cf3035c562c4b1e5b98a4c063d |
|
MD5 | 6b227e18e32636f55eb710789d966336 |
|
BLAKE2b-256 | bf0d0d2e65a877a2e2b294725f0fd38e189c0ed1450d7646be8e6e1eb995921b |