skillfed

pytest-embedded-serial

Make pytest-embedded plugin work with Serial.

pytest-embedded-serial v2.8.1 157.9K downloads/30d#10,742 on PyPI151
Permissive license Active released

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-serial

uv

uv add pytest-embedded-serial

poetry

poetry add pytest-embedded-serial

Installing 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

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Testing

Tags

pytest serial port testingembedded device testing pytestserial communication testingpytest embedded fixturesdevice serial interaction testingembedded systems test automationpytest serial device validation
embedded-systemsserial-testinghardware-testing

More Testing packages