This repository contains sample code for testing NuttX applications using pytest.
Link to the complete article regarding this example:
- communication.py: wraps the pyserial package in a simple serial communication that is used by pytest.
- conftest.py: general pytest setup and configuration.
- test_*.py: test files.
Follow those steps to bring up the test environment:
-
Create a Python virtual environment
$ python3 -m venv venv -
Activate the virtual environment
$ source venv/bin/activate -
Install the required packages
$ pip3 install -r requirements.txt
Simply call pytest with the proper arguments defined in conftest. Make sure to enter your actual board name and correct serial port.
$ pytest -v --board eps32h2-devkit --usbport /dev/tttyUSB0