Command-Line Options
This page is a reference for all command-line options and pytest.ini settings provided by pytest-embedded and its service extensions.
You can also view all available options from your terminal:
pytest --help
Option Syntax & Conventions
Boolean Options vs. Flags
``bool (y/n)``: Takes an explicit value —
y/yes/trueforTrue, orn/no/falseforFalse(case-insensitive). For example:--skip-autoflash yor--with-timestamp=false. Accepting an explicit string allows per-DUT|splitting and indirect parametrization.``flag``: A standard boolean switch that takes no argument and defaults to
False(e.g.--esp-flash-force).
Multi-DUT Values (|)
When --count is greater than 1, per-DUT options can be split with | (for example, --port /dev/ttyUSB0|/dev/ttyUSB1).
A single value without
|is applied to every DUT.Leave a slot empty when an option applies only to specific DUTs (for example,
--part-tool path/to/gen_esp32part.py|).Providing a different number of
|-separated values than--countraises aValueError.
See Key Concepts for full multi-DUT examples.
Parametrization
Most per-DUT CLI options can be overridden per test using @pytest.mark.parametrize(..., indirect=True) with the option’s underscored name (for example, app_path for --app-path or target for --target). Values resolve in the following order:
Parametrized value on the test function
CLI option value
Option default
Service Option Groups
Options under each embedded-<service> group take effect when the corresponding service is activated via --embedded-services.
Core Options
Options in the embedded group (plus --unity-test-report-mode) configure framework behavior, multi-device setups, parallel CI execution, logging, and JUnit reporting.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Comma-separated list of services to activate. Available services: |
|
integer (≥ 1) |
|
Number of DUTs in a single test case. When greater than |
|
string |
test file dir |
Path to the application directory or binary under test. Defaults to the directory containing the test script. |
|
string |
|
Name or relative path of the build directory inside |
|
bool (y/n) |
|
Enable or disable timestamp prefixes on live console log output. |
|
string |
|
File extension for saved DUT log files. |
|
string |
|
Path to an OpenMetrics / Prometheus text file for metrics recorded via the |
|
string |
system temp dir |
Session-based root directory where DUT log files are stored. |
|
string |
system temp dir |
Root directory for storing cache files (such as port-to-target mappings) across runs. |
|
integer (≥ 1) |
|
Total number of parallel jobs when splitting a test suite in CI. |
|
integer (≥ 1) |
|
1-based index of the current job out of |
|
bool (y/n) |
|
Fail collection if duplicate test case or test script names are detected. |
|
bool (y/n) |
|
Format and indent the generated JUnit XML report. |
|
choice |
|
How Unity test cases are written into the main JUnit XML report: |
Serial Options
Options in the embedded-serial group configure UART serial connections.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Serial port path (for example, |
|
string |
|
USB device location string ( |
|
integer |
|
Baud rate for serial communication with the target. |
Espressif SoC Options
Options in the embedded-esp group configure Espressif target detection, port filtering, and flashing via esptool.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Target chip family (for example, |
|
string |
same as |
Beta revision chip type for the serial target. |
|
string |
|
Dedicated serial port for flashing. Set only when the flashing port differs from |
|
integer |
|
Flashing baud rate passed to |
|
string |
|
MAC address of the target board, used to select a specific board among multiple connected devices. |
|
string |
|
Comma-separated list of USB serial numbers to filter candidate serial ports. |
|
bool (y/n) |
|
Disable automatic firmware flashing before running the test. |
|
bool (y/n) |
|
Erase the entire target flash before programming. |
|
flag |
|
Pass force mode to |
|
bool (y/n) |
|
Attach the |
ESP-IDF Options
Options in the embedded-idf group configure ESP-IDF target lists, partition table parsing, flash verification, and crash diagnostics.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Comma-separated list of officially supported targets used by |
|
string |
|
Comma-separated list of preview/experimental targets used by |
|
string |
|
Path to the ESP-IDF partition table tool used to parse partition tables. |
|
bool (y/n) |
|
Read the ELF SHA-256 from target flash and compare it against the local ELF in |
|
bool (y/n) |
|
Erase NVS partition blocks when flashing the target. Requires a valid |
|
bool (y/n) |
|
Skip automatic UART/flash core dump checking and panic handler decoding during teardown of a failing test. Requires a valid |
JTAG & OpenOCD Options
Options in the embedded-jtag group configure on-chip debugging with OpenOCD and GDB.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Path to the OpenOCD executable. |
|
string |
|
Command-line arguments passed to OpenOCD. |
|
string |
|
Path to the target-architecture GDB executable. |
|
string |
|
Command-line arguments passed to GDB. |
|
bool (y/n) |
|
Skip launching a GDB instance automatically when only OpenOCD is needed. |
QEMU Options
Options in the embedded-qemu group configure virtual target execution under QEMU.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Path to the QEMU flash image. |
|
string |
|
Path to the QEMU executable. |
|
string |
|
Default base arguments passed to QEMU. |
|
string |
|
Additional arguments appended to the QEMU command line. |
|
string |
|
Path to a virtual eFuse image file for QEMU simulation. |
|
bool (y/n) |
|
Disable automatic regeneration of the QEMU flash image. |
|
bool (y/n) |
|
Enable the flash pre-encryption workflow. |
|
string |
|
Path to the flash encryption key file used with |
esp-emu Options
Options in the embedded-espemu group configure lightweight Espressif SoC emulation with esp-emu.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Path to the merged flash image for |
|
string |
|
Path to the |
|
string |
|
Base arguments passed to |
|
string |
|
Path to an |
|
string |
|
Additional arguments appended to the |
Arduino Options
Options in the embedded-arduino group configure Arduino sketch testing.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
bool (y/n) |
|
Disable fast differential reflashing ( |
Wokwi Options
Options in the embedded-wokwi group configure Wokwi simulation.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Path to a custom Wokwi diagram JSON file. |
|
bool (y/n) |
|
Use the |
pytest.ini Options
pytest-embedded also registers configuration keys in pytest.ini (or pyproject.toml under [tool.pytest.ini_options]).
Option |
Type |
Default |
Description |
|---|---|---|---|
|
bool |
|
Record JUnit |
|
bool |
|
Deprecated. Alias for |
Example:
[pytest]
junit_path_relative_to_root = true
Behavior details:
Absolute paths inside pytest’s
rootdirare converted to relative paths. For Unity cases, relative compiler__FILE__paths are resolved against that DUT’s build directory and converted when the source file exists insiderootdir. Paths outsiderootdirand unresolved relative paths remain unchanged.The
app_pathfixture itself still returns the original path.For ESP-IDF compiler-generated paths starting with
/IDF/, set theIDF_PATHenvironment variable so they can be resolved againstrootdir.