Skip to content

command 'python.runtests' not found #3591

Closed

Description

@belesev

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

  1. d3r3kk commented on Jan 16, 2019

    @d3r3kk

    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..

  2. added
    bugIssue identified by VS Code Team member as probable bug
    info-neededIssue requires more information from poster
    and removed
    info-neededIssue requires more information from poster
    on Jan 16, 2019
  3. d3r3kk commented on Jan 16, 2019

    @d3r3kk

    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.

  4. jseppanen commented on Jun 7, 2019

    @jseppanen

    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

  5. connorsadler commented on Apr 29, 2020

    @connorsadler

    Same issue just now
    Any ideas how to resolve it?

  6. connorsadler commented on Apr 29, 2020

    @connorsadler

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

  7. EhsanKia commented on Nov 21, 2020

    @EhsanKia

    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".

  8. alistairwallace97 commented on Jan 6, 2021

    @alistairwallace97

    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.

  9. kimadeline commented on Jul 29, 2021

    @kimadeline

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

    image

  10. locked as resolved and limited conversation to collaborators on Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-testingbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions