VS Code unable to detect tests using environments and hatch #23706
Replies: 3 comments
-
I've cleared cached and restarted language server for Python but same issue. We checked with a colleague now and it works for him. Our computer are configured via Ansible, including VS Code, but there is obviously some difference. |
Beta Was this translation helpful? Give feedback.
-
I "Reset All Windows" and now I get the Run/Debug Dropdown:
|
Beta Was this translation helpful? Give feedback.
-
That's by design as discovery is implemented for pytest as a pytest plug-in, and so we need pytest to run. And we don't ship pytest w/ the extension as pytest has an API that your code relies on, and so we can't assume whatever version we ship will match the version you code against.
Can you open an issue using "Report Issue" about the missing environments? |
Beta Was this translation helpful? Give feedback.
-
Issue with VS Code not using the correct interpreter for a project and not
In our team some have this problem and for some it justworks. detecting pytest tests.
Background:
We have different Python projects (we use hatch) and we are moving them over to 3.12.x.
We therefore have to
select interpreter
choose workspace and then pick among the following:If I choose any of the 3.12.2, including topsky-stimulator, then VS Code won't be able to detect pytest tests due to pytest library not being installed
The tests will be detected if I
pip install pytest
to 3.12.2 (clean and/or topsky-stimulator), but it's the wrong way to go about it.Beta Was this translation helpful? Give feedback.
All reactions