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

Built distribution (wheel)

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

Total release size: 80.0 kB

Release files / pytest_embedded-2.11.0.tar.gz

Download URL pytest_embedded-2.11.0.tar.gz
Size 42.7 kB
Tags Source
SHA-256 checksum
How to use checksums
327a1ce9414140a2e918e3a626792de47d71f688168fd9e8e1a72bb2e2c8878c
BLAKE2b-256 checksum
How to use checksums
1466cb9cade585f328c3a723a4ea557227f3ab92e6e2c11c74081e8083638562
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

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

Download URL pytest_embedded-2.11.0-py3-none-any.whl
Size 37.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fc67a9b1746c0238233cce04922d46bc34a3500d317b274f5e5e1786b282807
BLAKE2b-256 checksum
How to use checksums
1bd4622a351863e5ac7c3020430a548f34f024a3cbc895931c3ecd8830dd30f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Security for pytest-embedded 2.11.0

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.0 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