question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

command 'python.runtests' not found

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:8

github_iconTop GitHub Comments

2reactions
alistairwallace97commented, Jan 6, 2021

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.

2reactions
EhsanKiacommented, 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.languageServer to be “Jedi” instead of “Pylance”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code - 'command python.runtests not found ...
I'm using Visual Studio Code to develop a python project and when I select the option to run all unit ...
Read more >
Testing Python in Visual Studio Code
Run tests · To run all discovered tests, select the play button at the top of Test Explorer: · To run a specific...
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
The unittest module can be used from the command line to run tests from ... skipTest("external resource not available") # test code that...
Read more >
Unittests | Python in Visual Studio Code
If not installed errors would be displayed in the Python Test Log output panel. ... Click the Run Tests statusbar button and select...
Read more >
How to invoke pytest — pytest documentation
Run tests in a module. pytest test_mod.py. Run tests in a directory. pytest testing/. Run tests by keyword expressions. pytest -k "MyClass and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found