Skip to content

pytest-libiio

libiio Logo

PyPI version Python versions See Build Status on Travis CI See Coverage Status on Coveralls

pytest-libiio is pytest plugin to manage interfacing with libiio contexts. This plugin is handy for leveraging the (new) zeroconf features of libiio to find, filter, and map libiio contexts to tests. It was created for pyadi-iio testing but is used in other applications that need an organized way to handle libiio contexts without hardcoding URIs or lots of boilerplate code.

Requirements

Optional for emulation support:

  • libtinyiiod and iio-emu
  • paramiko for additional metadata collection. Use the optional ssh argument when installing the package to get this automatically.
  • pip install pytest-libiio[ssh]

For development the following are also needed:

  • tox
  • pytest-mock
  • pre-commit
  • isort
  • flake8
  • codespell
  • black

Installation

You can install pytest-libiio via pip from PyPI:

$ pip install pytest-libiio

Usage

Please see the CLI and fixtures sections for information about using the plugin.

Future ideas

Mock testing is common with libiio's python library since hardware is needed otherwise. In future releases, we hope to extend features in pytest-mock through this plugin to make mocking libiio more streamlined.

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 BSD-3 license, pytest-libiio is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.