conftest.py: test the local west, not the installed one#883
conftest.py: test the local west, not the installed one#883marc-hb wants to merge 1 commit intozephyrproject-rtos:mainfrom
Conversation
Discovered by chance after uninstall west and trying to run pytest directly. This was hopefully not a problem when running test with "uv"? This issue was probably introduced by zephyrproject-rtos#859. Commit 879bb01 seems relevant too. Signed-off-by: Marc Herbert <[email protected]>
|
How did you run pytest? In the README it says to run `` pytest -o pythonpath=src` which actually already does this pythonpath extension. Did this not work for you? If not, I would prefer to set this option as tools.pytest.ini_option in the pyproject.toml instead of sys.path.insert. |
|
I missed the
As long as it stops people from testing (parts of?) the installed version by accident, fine by me! Would like me to do it? I'm not sure how. |
|
In PR #859, I considered adding that If more contributors run into your issue, we could consider making CC: @pdgendt |
Agreed.
So are you saying we cannot have both out of the box?
The real, serious issue here is: people running "pytest" alone do NOT realize they're probably testing a different version. So we'll never know how many people are affected. I realized only by chance after a long time. That's why documentation is not enough in this case. It would be preferable to FAIL rather than silently testing the wrong thing. Once it fails, then everyone checks the documentation. Or asks for help; but either way they don't keep testing the wrong version. |
I think this is a common issue for python packages... We could use the If we want developers to test the local version by default, we maybe should set the |
+1 |
|
#884 looks better |
Discovered by chance after uninstall west and trying to run pytest directly. This was hopefully not a problem when running test with "uv"?
This issue was probably introduced by #859. Commit 879bb01 seems relevant too.