pytest plugin for controlling execution flow
Project description
What?
pytest-node-dependency is a pytest plugin that allows you to define dependencies between tests and reorder their execution based on those dependencies. This plugin ensures that tests with dependencies run after their required prerequisites have completed successfully.
How to install?
pip install pytest-node-dependency
how to use?
To set up a test dependency, decorate the test function with the depends
mark and provide a list of dependencies via the on
keyword argument to the decorator. Dependencies can be specified by name only when in the same file as the test being decorated or by the pytest node path for tests in other files/classes.
import pytest
@pytest.mark.depends(on=['test_dependency'])
def test_my_test():
# Test code here
pass
def test_dependency():
# Code for the dependency test
pass
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
Close
Hashes for pytest-node-dependency-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3211c4b93c1ffb0a1fdeeb6418e1a45e91e976be64ea5b9b858c19b32339236c |
|
MD5 | 34a82010d7800761437ce5c9b405bb73 |
|
BLAKE2b-256 | 1fda52680424e57643a406c0a02b5c3ba0e0b8133479234b25b41831f0c5bd4e |
Close
Hashes for pytest_node_dependency-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5158f6020c627154a600a5742aed6bff7549d8e7c7a8e28401883a74ca173338 |
|
MD5 | 67d9289fe165cca5017beafb9ea66a08 |
|
BLAKE2b-256 | 0ab602f614d5d73cbf83bde40fbec409d500727340b19fe8f02c0da16a32df8f |