I'm using Visual Studio Code to develop a python project and when I select the option to run all unit tests, I get the following error: 'command 'python.runtests' not found
In my project I'm the unittest package and I have a settings.json file that has the following configuration (see below):
{
"python.unitTest.unittestArgs": [ "-v","-s", ".//Test", "-p", "*_test.py" ],
"python.unitTest.unittestEnabled": true,
"python.unitTest.pyTestEnabled": false,
"python.unitTest.nosetestsEnabled": false
}
All my unit tests classes are under a folder called Test folder.
Please help, thanks in advance.
You don't have to reinstall the Python extension. Instead, enable the Jedi
Python Language Server:
{
"python.languageServer": "Jedi",
"python.unitTest.unittestArgs": ["-v", "-s", ".//Test", "-p", "*_test.py"],
"python.unitTest.unittestEnabled": true,
"python.unitTest.pyTestEnabled": false,
"python.unitTest.nosetestsEnabled": false
}
Note that the setting python.jediEnabled
has been removed in favor of the python.languageServer
setting according to this post referring to this VSCode changelog.
I just had the same problem, and it was common to all my Python workspaces
The solution for me was nice and simple though - simply uninstall the VSCode Python extension and then reinstall it.
Robert
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With