Open MSLeiter opened 2 years ago
@MSLeiter Thank you for the issue! Hm, maybe I'm missing something in your configuration, but the extension won't attempt to discover tests by default. Test discovery is triggered when one of the python.testing.unittestEnabled
, python.testing.pyTestEnabled
, or pythonTestExplorer.testFramework
options is set. Is it possible that you see this error because you've enabled test discovery globally (e.g. in User settings or System settings)? Does it make sense for you to move this to the workplace settings?
I'm getting the following error with the Python Test adapter and Pytest:![image](https://user-images.githubusercontent.com/101780176/167050247-53ad50a2-a495-4eff-b7d7-02e73691e237.png)
All the errors have a message like the following:
This is a workspace where I have added a bunch of reference folders that are not part of my code, but they have files I want to search, copy from, etc.
The extension is working great in Python folders that are properly setup for Pytest (though I don't really want it to run in folders that aren't part of this codebase - I don't see a way to stop it though). It appears for the errors that the Test Explorer is attempting to run pytest from a virtual environment in each folder. i.e. the Python Interpreter is setup as "./.venv" and therefore the Test Explorer is going to every folder in the workspace and running Python as though there must be a "./.venv" virtual environment in each folder. When it can't find the
./.venv/Scripts/python.exe
file to run pytest with, it errors out.Assuming this is the issue, I suggest a something like:
One or both of the above. I'd love to be able to quickly tell the test explorer to ignore several folders that I don't want it to discover tests in.