I am running a python project in vscode with virtualenv
. Python interpreter is set right. When I'm trying to discover tests it gives me an error saying
python /Users/user/.vscode/extensions/ms-python.python-2019.10.44104/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s project/
Test Discovery failed:
Error: spawn /Users/<username>/apps/project/venv/bin/python ENOENT
My vscode settings.json looks something like this and I haven't configured launch.json
{
"python.pythonPath": "/Users/<username>/apps/project/venv/bin/python",
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"project"
],
}
When I just type /Users/<username>/apps/project/venv/bin/python
on terminal python shell opens up.
ENOENT Generally means that it's an invalid path, but the path seems perfectly fine.
$echo $PATH
/Users/<username>/apps/project/venv/bin