--- id: pytest-embedded version: "2.8.1" license: unclear license_treatment: permissive maintenance: active --- # pytest-embedded — A pytest plugin that designed for embedded testing. License: permissive · Maintenance: active · Downloads: 88.9K/mo ## 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 above — 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 pip install pytest-embedded uv add pytest-embedded 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_current - Install friction: low - Maintenance: active - Downloads: 88.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest embedded testing plugin, serial port testing fixtures, device interaction testing, expect-style pattern matching, embedded systems test automation, device simulation testing, firmware testing framework, embedded-systems, firmware-testing, serial-communication [View on SkillFed](https://skillfed.io/packages/pytest-embedded) · [View on PyPI](https://pypi.org/project/pytest-embedded/)