PyTest Molecule Plugin :: discover and run molecule tests
Project description
PyTest Molecule Plugin :: auto detects and runs molecule tests
This plugin enables pytest discovery of all molecule.yml files inside the codebase and runs them as pytest tests.
Once you install pytest-molecule you should be able to just run pytest in order to run molecule on all roles and scenarios.
Optionally you can define MOLECULE_OPTS for passing extra parameters to each molecule call.
Discovered tests do have molecule driver and platforms added as markers, so you can selectively limit which test types to run:
# Lists all tests that uses docker
$ pytest --collect-only -m docker
# Runs scenarios with platform named centos7 and delegated driver:
$ pytest -m delegated -m centos7
Please note that at this moment molecule will run the entire scenario if the markers are platforms, this is not yet a way to limit which platforms are executed inside a specific scenario.
All tests are added the molecule marker.
Installation
You can install “pytest-molecule” via pip from PyPI:
.. code-block:: shell
$ PIP_NO_BUILD_ISOLATION=false pip install pytest-molecule
PIP_NO_BUILD_ISOLATION is needed only on ancient python distributions to workaround https://github.com/pypa/pip/issues/5229
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-molecule” 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
Built Distribution
Hashes for pytest_molecule-1.1.0rc5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b38775740ecbd30c9afd20969d8f9056c70d49bf4a1b381adb26a520a5caa97 |
|
MD5 | e599ce1d188685e5c87132accb6bcf7c |
|
BLAKE2b-256 | 819093b12b02a66a57be52f562dbf5f08f39d3e7d048216318c33a06627e6346 |