Make pytest-embedded plugin work with ESP-IDF.
Actively maintained. Last release 5 days ago, commits in 16 of the last 26 weeks. A safe choice.
$
pip install pytest-embedded-idfpytest-embedded-idf
A pytest-embedded service tailored for ESP-IDF applications and test workflows.
Service Activation
Activate this service by passing idf to --embedded-services. Typically used together with esp for physical hardware testing:
pytest --embedded-services esp,idf --app-path /path/to/esp-idf-app
Extra Functionalities
- App Metadata Parsing: Reads
project_description.jsonand build artifacts to identify the target chip, flash settings, partition tables, and binary paths. - Smart Flashing & Caching: Automatically flashes the bootloader, partition table, and application. Caches binary hashes across the session to skip redundant flashing.
- Panic & Core Dump Decoding: Automatically parses and decodes panic stack traces and core dumps from target flash/UART when a test fails.
- Partition Table & NVS Controls: Erase NVS blocks or customize the partition tool script.
- Unity Test Runner: Integrated support for Unity C test suites via
dut.expect_unity_test_output()and thecase_testerfixture for test menu navigation. - Linux Target Support: Includes
LinuxDutandLinuxSerialto test ESP-IDF POSIX/Linux applications directly on the host machine. - Dynamic Parametrization: Provides
idf_parametrizeto expandsupported_targetsand filter chips by SoC capability strings.
CLI Options
--supported-targets: Comma-separated list of officially supported targets for the test. Default:None.--preview-targets: Comma-separated list of preview/experimental targets for the test. Default:None.--part-tool: Path to the partition table generator script. Default:$IDF_PATH/components/partition_table/gen_esp32part.py.--confirm-target-elf-sha256: Verify ELF SHA256 against target flash before skipping re-flashing. Default:False.--erase-nvs: Erase NVS partition blocks when flashing binaries. Default:False.