Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command 'python.runtests' not found #3591

Closed
belesev opened this issue Dec 7, 2018 · 8 comments · Fixed by #16769
Closed

command 'python.runtests' not found #3591

belesev opened this issue Dec 7, 2018 · 8 comments · Fixed by #16769
Labels
area-testing bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@belesev
Copy link

belesev commented Dec 7, 2018

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

@d3r3kk
Copy link

d3r3kk commented 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 d3r3kk added bug Issue identified by VS Code Team member as probable bug area-testing info-needed Issue requires more information from poster triage and removed triage info-needed Issue requires more information from poster labels Jan 16, 2019
@d3r3kk
Copy link

d3r3kk commented 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
Copy link

jseppanen commented 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 fine

I uninstalled and reinstalled the Python extension but that had no effect

$ code --version
1.35.0
553cfb2c2205db5f15f3ee8395bbd5cf066d357d
x64

Python extension 2019.5.18875

@connorsadler
Copy link

Same issue just now
Any ideas how to resolve it?

@connorsadler
Copy link

I had switched jedi off recently - switched it back on and things are working now

@EhsanKia
Copy link

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.languageServer to be "Jedi" instead of "Pylance".

@alistairwallace97
Copy link

VSCode version (1.49.3 user setup)
Python extension version: v2020.12.424452561
My python.languageServer was 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
Copy link

Fixed by #16769, test commands do not rely on language servers anymore:

image

@kimadeline kimadeline added the verified Verification succeeded label Jul 29, 2021
@karthiknadig karthiknadig added this to the August 2021 milestone Aug 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants