'Writing Python tests for the ESP32?
I am using an ESP32 and my computer (Windows). I want to write python tests for the ESP32 using the pytest framework. I read into how CPython can be the middle man to communicate between the ESP32 and python.My end goal was to have all the Python dependencies and python test code on the host to test the target. If this is true, how can it be done?
I am struggling with understanding how python can be used for testing embedded systems, since python is a high level language while the ESP32 is written in C/C++ a low level language.
Solution 1:[1]
Some of the examples in ESP-IDF include python tests (e.g. examples/storage/sd_card/sdspi/sd_card_example_test.py) and seem to use tiny_test_fw which has some documentation here:
https://esp-mdf.readthedocs.io/en/latest/
I am also looking into doing unit testing on the esp32 but it seems like the preferred way is to use Unity: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/unit-tests.html
It supports running tests across multiple devices and between resets, and has pretty good documentation.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ankostis |
