[idf 5.2.2] pytest does not collect any tests if I run project outside of IDF installation examples directory

ZeroSebastian
Posts: 1
Joined: Fri Oct 11, 2024 7:18 am

[idf 5.2.2] pytest does not collect any tests if I run project outside of IDF installation examples directory

Postby ZeroSebastian » Fri Oct 11, 2024 7:37 am

Hello,

I'm getting into using the ESP-IDF and i like it very much so far. I've installed v5.2.2 on my linux machine.
I just tried to implement a simple test case with pytest and followed all the steps from https://docs.espressif.com/projects/esp ... %20project.

I simply copied the hello_world example from the idf examples to a local folder inside my home directory (test/hello_world). Whenever I execute pytest -v --target esp32s3 I get the following output:

Code: Select all

============================================ test session starts =============================================
platform linux -- Python 3.10.12, pytest-8.3.3, pluggy-1.5.0 -- /home/sebbl/.espressif/python_env/idf5.2_py3.10_env/bin/python
cachedir: .pytest_cache
rootdir: /home/sebbl/test/hello_world
plugins: ignore-test-results-0.2.2, embedded-1.11.5, rerunfailures-14.0, timeout-2.3.1
collected 0 items 
I would be expecting that the tests from pytest_hello_world.py would be collected and executed.

However, when I navigate into the esp idf (~/esp/esp-idf-v5.2.2/examples/get-started/hello_world) and execute pytest --target esp32s3 three tests are found and are executed.

Also, if I copy the ~/esp/esp-idf-v5.2.2/examples/get-started/hello_world with all included build files and simply execute pytest --target esp32s3, no tests are collected again. I am pretty clueless here and have not found similar issues in the internet yet.

I am very grateful for help with this issue.

Cheers,
ZeroSebastian

Who is online

Users browsing this forum: atx823, MicroController and 172 guests