pytest-embedded-arduino

class pytest_embedded_arduino.app.ArduinoApp(**kwargs)

Bases: App

Arduino App class

sketch

Sketch name.

Type:

str

fqbn

Fully Qualified Board Name.

Type:

str

target

ESPxx chip.

Type:

str

flash_settings

Flash settings for the target.

Type:

dict[str, str]

flash_files

(address, filepath) pairs parsed from flash_args. Each filepath is absolute.

Type:

list[tuple[str, str]]

binary_file

Application binary file path (.ino.merged.bin if present, otherwise .ino.bin).

Type:

str

elf_file

ELF file path.

Type:

str

class pytest_embedded_arduino.serial.ArduinoSerial(app: ArduinoApp, target: str | None = None, fast_flash: bool = True, **kwargs)

Bases: EspSerial

Arduino serial Dut class

Auto flash the app while starting test.

SUGGEST_FLASH_BAUDRATE = 921600
erase_flash(force: bool = False) None

Erase the complete flash and invalidate all fast-flash reference binaries.

flash() None

Flash individual binary files to the board.

Uses esptool’s --diff-with for fast reflashing when reference binaries from the previous successful flash are available, writing only changed 4 KB sectors. References are saved after each successful flash and invalidated by erase_flash().

Unlike the merged-binary approach, individual binaries do not overlap with writable flash regions (NVS, OTA data, etc.), so the post-flash MD5 verification succeeds and --diff-with works correctly.