pytest-embedded-serial
Make pytest-embedded plugin work with Serial.
What it is and what it does
pytest-embedded-serial is a pytest plugin that extends the pytest-embedded framework specifically for serial port communication with embedded devices. It provides fixtures like `Dut` (Device Under Test) that allow you to send commands to and capture output from devices connected via serial, using pattern matching methods like `expect()` and `expect_exact()` to validate device behavior.
The plugin is designed for testing embedded systems where you need to interact with hardware over serial connections. It depends on pytest-embedded for core functionality and pyserial for low-level serial port access. The plugin supports semantic versioning and is actively maintained, with support for modern Python versions (3.10 through 3.14).
Use it for:
- Test firmware output from microcontroller boards connected via USB serial
- Validate command-response behavior of embedded devices during CI/CD pipelines
- Automate serial port interaction testing for IoT device prototypes
- Capture and assert on device debug logs and diagnostic output over serial
- Integration testing of embedded applications with real hardware or emulation
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that enables serial port testing for embedded systems, providing fixtures and utilities to interact with and validate device behavior over serial connections.
Yes. This is a stable, actively maintained plugin for a specific but important use case: testing embedded systems over serial connections. Low install friction, permissive license, no known vulnerabilities, and recent activity make it a reliable choice if you need pytest-based serial device testing.
Install
pytest-embedded-serial on PyPI
pip
pip install pytest-embedded-serialuv
uv add pytest-embedded-serialpoetry
poetry add pytest-embedded-serialInstalling pytest-embedded-serial
Before you install
Low friction install with a pure-Python wheel. Actively maintained with a recent release; last commit on 2026-08-10 and 59 days since the latest release indicate steady development.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, even in commercial projects.
Quickstart
pip install pytest-embedded-serial
from pytest_embedded import Dut
def test_serial_device(dut: Dut):
dut.expect('expected_output')
dut.expect_exact('exact_match')
Requires Python 3.10 or later; pyserial must be available for serial port access.
Verify before relying
- Whether the serial service is automatically enabled or requires --embedded-services serial flag
- Specific serial port configuration requirements (baud rate, timeout defaults)
- Whether pyserial is bundled or must be installed separately for serial functionality
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pytest-embedded, pyserial |
| Maintenance | actively maintained — 59 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 157,907/month — #10,742 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_embedded_serial-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-embeddedA pytest plugin that provides fixtures and…
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-qemuA pytest plugin that runs embedded system tests…
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
esp-idf-monitorProvides serial communication monitoring and…
permissive · top 15,000 on PyPI
imgtoolimgtool signs and manages cryptographic keys…
permissive · top 5,000 on PyPI
pioarduinopioarduino is a build system and embedded…
permissive · top 15,000 on PyPI