skillfed

pytest-embedded

A pytest plugin that designed for embedded testing.

pytest-embedded v2.8.1 88.9K downloads/30d#13,698 on PyPI151
Permissive license Active released

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

uv

uv add pytest-embedded

poetry

poetry add pytest-embedded

Installing 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

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 embedded testing pluginserial port testing fixturesdevice interaction testingexpect-style pattern matchingembedded systems test automationdevice simulation testingfirmware testing framework
embedded-systemsfirmware-testingserial-communication

More Testing packages