pytest-embedded
A pytest plugin that designed for embedded testing.
What it is and what it does
pytest-embedded is a pytest plugin designed to simplify testing of embedded systems and microcontroller projects. It provides a Dut (Device Under Test) fixture that wraps interaction with embedded devices, offering expect-style pattern matching (exact matches, regex patterns) and output redirection. The plugin integrates with pytest's test discovery and reporting, letting you write embedded tests as ordinary pytest functions.
The plugin ships with a core set of fixtures and can be extended via optional services—serial port utilities, device auto-detection, integration with build systems, JTAG/GDB support, and simulation backends like QEMU and Wokwi. Services are activated via command-line flags and require their corresponding optional dependencies. It targets modern Python (3.10+) and is actively maintained.
Use it for:
- Test firmware by flashing binaries and validating serial output patterns with expect-style matching.
- Automate interaction with embedded devices over serial ports using exact and regex pattern matching.
- Run embedded test suites in CI/CD pipelines with QEMU or Wokwi simulation instead of physical hardware.
- Validate firmware behavior across multiple target platforms with a unified test interface.
- Capture and assert on device output in real time during development and regression testing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that provides fixtures and services for testing embedded systems, with built-in support for serial communication, device detection, and interaction patterns like expect-style matching.
Yes, if you are testing embedded systems or microcontroller firmware. Low install friction, active maintenance, permissive license, and no known vulnerabilities make it a safe choice. The plugin integrates cleanly with pytest and offers both basic serial interaction and advanced services for specialized workflows. Not relevant for non-embedded testing.
Install
pytest-embedded on PyPI
pip
pip install pytest-embeddeduv
uv add pytest-embeddedpoetry
poetry add pytest-embeddedInstalling pytest-embedded
Before you install
Low friction install with only three runtime dependencies (pytest, pexpect, filelock). Actively maintained with a recent release 59 days ago and ongoing repository activity.
License in practice
MIT license (permissive) means you can use this freely in commercial and private projects with minimal restrictions.
Quickstart
pip install pytest-embedded
from pytest_embedded import Dut
def test_basic(dut: Dut):
dut.expect('expected_output')
dut.expect_exact('exact_match')
Requires Python 3.10 or later; some services (serial, esp, idf, jtag, qemu, arduino, wokwi, nuttx) require optional dependencies installed separately.
Verify before relying
- Whether optional service dependencies are automatically installed or must be added manually.
- Performance characteristics when running large test suites or interacting with slow serial devices.
- Compatibility with non-Espressif embedded platforms beyond the documented services.
- Specific target platforms and microcontroller families supported by the esp and idf services.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pytest, pexpect, filelock |
| Maintenance | actively maintained — 59 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,855/month — #13,698 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_embedded-2.8.1-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-embedded-qemuA pytest plugin that runs embedded system tests…
permissive · top 15,000 on PyPI
pytest-embedded-serialA pytest plugin that enables serial port…
permissive · top 15,000 on PyPI
pytest-embedded-jtagAdds JTAG debugging utilities to…
permissive · top 15,000 on PyPI
pytest-embedded-serial-espA pytest plugin that provides fixtures and…
permissive · top 15,000 on PyPI
pytest-embedded-idfA pytest plugin that integrates ESP-IDF…
permissive · top 15,000 on PyPI
pytest-deadfixturesA pytest plugin that identifies unused and…
permissive · top 5,000 on PyPI
esptoolesptool is a serial utility for flashing,…
copyleft · top 5,000 on PyPI
imgtoolimgtool signs and manages cryptographic keys…
permissive · top 5,000 on PyPI
esp-idf-monitorProvides serial communication monitoring and…
permissive · top 15,000 on PyPI
pioarduinopioarduino is a build system and embedded…
permissive · top 15,000 on PyPI