A plugin that reads a config.json file in your test root directory, searches the 'markers' key, lists the markers declared as 'true' as enabled markers and automatically adds -m option to the command line with an OR on the enabled markers.
Project description
A plugin that reads a json file in your test root directory, searches the ‘markers’ key, lists the markers declared as ‘true’ as enabled markers and automatically adds -m option to the command line with an OR on the enabled markers.
This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.
Requirements
json >= 2.0.9
Installation
You can install “pytest-himark” via pip from PyPI:
$ pip install pytest-himark
Usage
After installing this plugin, pytest will automatically load it when launching tests. You will simply need to add the –json option to the command line with the path to the json containing the markers you want to enable. Alternatively, you can add the –json option and the path in the pytest.ini directly, in the addopts variable.
- Example:
pytest.ini:
addopts = --json=path/to/my/config.json
config.json:
{
"markers": {
"my_marker1": true,
"my_marker2": true,
"my_marker3": false
}
}
Launching pytest now will automatically add he following to the command line:
>> pytest -m "my_marker1 or my_marker2"
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
License
Distributed under the terms of the MIT license, “pytest-himark” is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pytest-himark-0.1.1.tar.gz
.
File metadata
- Download URL: pytest-himark-0.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4370b37280929eccf4e6b204b6cc938c50cf8cad11a8ab0d2e114622be01c248 |
|
MD5 | b207df988a1eb99236fc52bc00bdd063 |
|
BLAKE2b-256 | b2231569018bde16ef89cdfca96376cdad0aa5055a845cf5f15f6460bf3b48d8 |