command 'python.runtests' not found #3591
Description
Environment data
- VS Code version: 1.29.1
- Extension version (available under the Extensions sidebar): 2018.11.0
- OS and version: Windows 10 Enterprise x64
- Python version (& distribution if applicable, e.g. Anaconda): 2.7.13 32-bit
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions:
pytest 4.0.1
Expected behaviour
Running command with tests (run tests, debug tests, etc.)
Actual behaviour
Popup message in the bottom right corner (with red "X" symbol):
command 'python.runtests' not found
command 'python.debugtests' not found
command 'python.discoverTests' not found
command 'python.runCurrentTestFile' not found
Steps to reproduce:
Ctrl+Shift+P
Choose "Python: Run all unit tests" or "Debug all unit tests" or any other command with testing.
Logs
Output for Python in the Output panel is empty when getting this error
Output from Console is empty.
##Other info:
Reinstalling VS Code didn't help.
Reinstalling Python package (with reload of VS code of course) didn't help.
Reboot didn't help.
Removing C:\Users\_USERDIR_\.vscode\extensions (and installing then extension again) didn't help.
pip uninstall pytest + pip install pytest didn't help.
It looks like the extension installation is corrupted.
Am I missing some cache clearing option to fix the issue?
UPD.: my work PC is behind the proxy. It might be valuable
Activity
d3r3kk commentedon Jan 16, 2019
I cannot reproduce this behaviour at all - I don't see the popup messages that you see when I install the extension in VS Code and load up a simple test case.
I think if you were to update to the latest extension it might help, could you try that?
You might need to fill in the Http: Proxy settings in your VS Code settings, but I really doubt there is a problem with regard to this. Please refer to this document to see if this is relevant - since you can install the extension I rather think not..
d3r3kk commentedon Jan 16, 2019
It turns out I can reproduce this with the latest extension code in VS Code Insiders!
Using this as the workspace:
3591_no_test_commands_available.zip
Follow the README.md file included to get the repro case up and running.
Workaround still seems to be running VS Code (stable, not insiders) and update to the latest stable version of the extension.
jseppanen commentedon Jun 7, 2019
I started getting the same error (
command 'python.runtests' not found) when trying to run tests on a python project that used to work just fineI uninstalled and reinstalled the Python extension but that had no effect
Python extension 2019.5.18875
connorsadler commentedon Apr 29, 2020
Same issue just now
Any ideas how to resolve it?
connorsadler commentedon Apr 29, 2020
I had switched jedi off recently - switched it back on and things are working now
EhsanKia commentedon Nov 21, 2020
To clarify, this is the Python language server. In my case, I had switched to Pylance but hit an issue, so I switched back by uninstalling Pylance, but I needed to update
python.languageServerto be "Jedi" instead of "Pylance".alistairwallace97 commentedon Jan 6, 2021
VSCode version (1.49.3 user setup)
Python extension version: v2020.12.424452561
My
python.languageServerwas set to "Microsoft", changing it to "Jedi" fixed it so I could discover tests. I don't remember setting it to "Microsoft" in the first place but I probably did by mistake at some point.NB: I don't have the Pylance extension installed.
Hope this is helpful for someone else.
kimadeline commentedon Jul 29, 2021
Fixed by #16769, test commands do not rely on language servers anymore: