Skip to main content
PyPI version Python versions See Build Status on GitHub Actions See Coverage Status on Coveralls Documentation Build Status

A pytest plugin to manage interfacing with libiio contexts


pytest-libiio is pytest plugin to manage interfacing with libiio contexts. This plugin is handy for leveraging the 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

  • libiio and pylibiio

  • pytest

  • pyyaml

Optional for emulation support:

Optional for SSH telemetry collection:

  • paramiko (or install with pip install pytest-libiio[ssh])

For development the following are also needed:

  • nox

  • pytest-mock

  • pre-commit

  • ruff

Installation

You can install “pytest-libiio” via pip from PyPI:

$ pip install pytest-libiio

Usage

The plugin exposes three pytest fixtures — iio_uri, single_ctx_desc, and context_desc — plus an iio_hardware marker that filters tests by detected hardware. The full reference and scenario walkthroughs (emulation, attribute coverage, telemetry, xdist) live in the hosted documentation.

Quickstart — get a URI for a marked board and open the context:

import iio
import pytest


@pytest.mark.iio_hardware("pluto")
def test_pluto(iio_uri):
    ctx = iio.Context(iio_uri)
    assert ctx.find_device("ad9361-phy") is not None

Fan out across every matching board with context_desc:

import iio
import pytest


@pytest.mark.iio_hardware(["pluto", "adrv9361", "fmcomms2"])
def test_all_matching_boards(context_desc):
    for ctx_desc in context_desc:
        ctx = iio.Context(ctx_desc["uri"])
        ...

Run against the bundled ADI hardware map so the marker names resolve:

pytest --adi-hw-map

Contributing

Contributions are very welcome. Tests run via nox (nox -s tests); please ensure coverage at least stays the same before submitting 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.

Release files for pytest-libiio 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-libiio 0.2.0
File Size Uploaded
pytest_libiio-0.2.0.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-libiio 0.2.0
File Interpreter ABI Platform
pytest_libiio-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / pytest_libiio-0.2.0.tar.gz

Download URL pytest_libiio-0.2.0.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
f7ee6d572b8471369c817709bc296aab6735f0ebaec63ca6b41d359eca5f5c21
BLAKE2b-256 checksum
How to use checksums
b9e5fd629a0f487604a00e52978d80186f3e03f8229544412ec815d70af91592
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / pytest_libiio-0.2.0-py3-none-any.whl

Download URL pytest_libiio-0.2.0-py3-none-any.whl
Size 112.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bbac566bb9a011c755dd8bcc504a2512f44de1c29e4b2bb98500ba64d6946c7
BLAKE2b-256 checksum
How to use checksums
19472f22267459793e97c80bcef6b1201c1c066b467ae0b7af0474daada5b71e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.0

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.21

1 release file

0.0.20

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page