Pytest plugin to operate with objects generated by Simbind tool.
Project description
pytest-simbind
pytest-simbind is pytest plugin that facilitates SiL testing of Simbind objects.
Specially, pytest-simbind allows to overcome main limitation of Simbind generated objects:
Due to the nature of binding technology you can instantiate Model class only once within a single process, all consequent instances will have the same state(time, input, and output props) as the first instance. If you need to instantiate multiple objects we recommend doing it in separate processes.
In the nutshell, pytest-simbind provides similar functionality as pytest-xdist running each simbind marked test in new process:
import pytest, pytest_simbind
from model import Model
@pytest_simbind.fixture
def model():
return Model()
@pytest.mark.simbind
def some_test(model: Model):
...
Notice @pytest_simbind.fixture and @pytest.mark.simbind:
- @pytest_simbind.fixture helps pytest to keep track on Simbind fixture lifecycle and is mandatory if you need to use plugin's API.
- @pytest.mark.simbind signifies pytest to run specified test in separate process.
Installation
To install pytest-simbind run:
$ pip install pytest-simbind
Requirements
You will need Python 3.10+ to run plugin. Additionally, plugin inherits some requirements from Simbind generated objects: while you can test your Mock model under any operational system, SiL model requires Linux! To learn more about Mock and SiL packages structure and usage, refer to Simbind Wiki.
Using API
pytest-simbind provides asynchronous API to:
- dynamically select tests
- collect Simbind model's data, test logs and fail reports.
For more information and examples please refer to Wiki
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_simbind-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b7b3a15ae39560542ff96597f8a309942621b13b51cf64f5e56c0fb79d3c997 |
|
MD5 | 1ac30726fd5694615b7c9f7aaa16686c |
|
BLAKE2b-256 | 1980f541e8b5c126184ecf8fd5f9b4aaf3b17dc9e92c8d1da48904284dc26cbb |