You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the following error with the Python Test adapter and Pytest:
All the errors have a message like the following:
Test loading failed: Error: Error occurred during process execution: Error: spawn d:\code\mca_app\_simulink\.venv\Scripts\python.exe ENOENT
Error: Error occurred during process execution: Error: spawn d:\code\mca_app\_simulink\.venv\Scripts\python.exe ENOENT
at ChildProcess.<anonymous> (c:\Users\Mike.Leiter\.vscode\extensions\littlefoxteam.vscode-python-test-adapter-0.7.1\out\src\processRunner.js:37:28)
at Object.onceWrapper (events.js:422:26)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
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:
In each workspace folder, check if the python executable exists as a file, if not, do not run discovery on that folder. It should probably display somehow that the folder was ignored - perhaps leave an entry for the folder in the list, but instead of a big, red error icon, add some neutral icon with a comment that the folder was ignored. If the user clicks on that row, it should still open the the output window where some additional details could be given (i.e. 'For folder "x", Python executable "y" could not be found. Skipping test discovery'.)
Still give us an error (though a more understandable message would be great), but give us a way of turning off discovery for any given folder with a setting. Preferably, you could add folders to the list by just right-clicking them in the test explorer window and selecting a new option like "ignore this folder for test discovery in this workspace".
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.
The text was updated successfully, but these errors were encountered:
@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:
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.
The text was updated successfully, but these errors were encountered: