Skip to main content

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. For a ready-to-use service solution refer to Simtest.

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 allows 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 test_something(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 and run tests
  • collect Simbind model's data, test logs and fail reports.

For more information and examples please refer to Wiki. Simtest can also be used as an example and source of code snippets on how to interact with the plugin's API.

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

pytest-simbind-0.1.2.tar.gz (43.6 kB view hashes)

Uploaded Source

Built Distribution

pytest_simbind-0.1.2-py3-none-any.whl (34.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page