Skip to main content

pytest-embedded

The core plugin for the pytest-embedded framework. Designed for embedded testing across multiple targets and environments.

Key Features

  • Core Fixtures: Provides essential fixtures including dut, app, msg_queue, pexpect_proc, and redirect.
  • String & Regex Matching: Integrates pexpect for powerful output parsing with dut.expect() and dut.expect_exact().
  • Multi-DUT Orchestration: Test multi-device topologies (such as master-slave or mesh networks) using --count.
  • Flexible Parametrization: Easily parametrize apps, targets, and services using pytest markers.
  • Unified Test Reports: Parse and merge embedded Unity test results into JUnit XML reports.

Unity case names and item results

Implement pytest_custom_unity_case_name(item, case_name) in a plugin or conftest.py to customize Unity child-case names. Return a string for the final name, or None to retain the original name:

def pytest_custom_unity_case_name(item, case_name):
    return f'{item.name}::{case_name}'

At call report time, pytest-embedded stores the same final names in item.stash[pytest_embedded.unity.UnityCasesStashKey] as a list of UnityCase(name, result). Results are passed, failed, or skipped. The merged JUnit XML uses these names too. For multi-DUT tests the list includes each DUT's cases; without a naming hook, names are unchanged.

Quickstart

from pytest_embedded import Dut


def test_basic_expect(redirect, dut: Dut):
    with redirect():
        print('Ready to test!')

    dut.expect('Ready to test!')

Run the test:

pytest test_basic.py -s

Metadata

Release files for pytest-embedded 2.11.1

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-embedded 2.11.1
File Size Uploaded Provenance Actions
pytest_embedded-2.11.1.tar.gz 43.7 kB Without provenance Details for pytest_embedded-2.11.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-embedded 2.11.1
File Interpreter ABI Platform Actions
pytest_embedded-2.11.1-py3-none-any.whl Python 3 none any Details for pytest_embedded-2.11.1-py3-none-any.whl

Total release size: 81.6 kB

Release files / pytest_embedded-2.11.1.tar.gz

Download URL pytest_embedded-2.11.1.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
05717b77db5096adc4be449d2f4e1e3d5aafa465c461b604f6bbb63765abe698
BLAKE2b-256 checksum
How to use checksums
1c503d86e76ac538b8e170307ef6eded7639205b44844724c271acbecf61cd8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / pytest_embedded-2.11.1-py3-none-any.whl

Download URL pytest_embedded-2.11.1-py3-none-any.whl
Size 38.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44b697bb314d0823885be00206cdf99992e20e3b8f0e08643fd01f1b745c8f37
BLAKE2b-256 checksum
How to use checksums
a7467a77641b43ed7b18214bdd825db2bace6c4b04c5656577236aae9e55335a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Security for pytest-embedded 2.11.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.11.1 This release

2 release files No provenance

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