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.

Debugging tests is returning errors due to "unsupported status"

See original GitHub issue

Environment data

  • VS Code version: 1.54.3
  • Extension version (available under the Extensions sidebar): v2021.4.668904848-dev
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
  • Relevant/affected Python packages and their versions: pytest 6.2.2

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Actual behaviour

Debugging tests shows an error notification even though the test passes: image

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Clone this project: https://github.com/luabud/pvscc-logo
  2. Create a virtual environment and install the dependencies
  3. Run Python: Configure Tests, select pytest and then . for root directory.
  4. Open tests.py and change line 13 to str instead of io.BytesIO
  5. Run the test and see that it passes
  6. Now click to debug this test
  7. Watch the error notification pop up even though the debugger session started properly and everything.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonJoinMailingListVar3'
User belongs to experiment group 'pythonSendEntireLineToREPL'
User belongs to experiment group 'pythonNotDisplayLinterPrompt'
User belongs to experiment group 'pythonDiscoveryModule'
User belongs to experiment group 'pythonTensorboardExperimentcf'
User belongs to experiment group 'DeprecatePythonPath - experiment'
User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'
User belongs to experiment group 'CollectLSRequestTiming - control'
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Python interpreter path: .\env\Scripts\python.exe
Starting Jedi language server.
> c:\Users\luabud\Apps\pvscc-logo\env\Scripts\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir c:\Users\luabud\Apps\pvscc-logo -s --cache-clear .
cwd: c:\Users\luabud\Apps\pvscc-logo
> c:\Users\luabud\Apps\pvscc-logo\env\Scripts\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py pytest --override-ini junit_family=xunit1 --rootdir c:\Users\luabud\Apps\pvscc-logo --junit-xml=C:\Users\luabud\AppData\Local\Temp\tmp-34824nVG8ptp2l1BN.xml .
cwd: c:\Users\luabud\Apps\pvscc-logo

Output for Python Test Log in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir c:\Users\luabud\Apps\pvscc-logo -s --cache-clear .
============================= test session starts =============================
platform win32 -- Python 3.8.8, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: c:\Users\luabud\Apps\pvscc-logo, configfile: pytest.ini
collected 1 item

tests.py .                                                               [100%]

- generated xml file: C:\Users\luabud\AppData\Local\Temp\tmp-34824nVG8ptp2l1BN.xml -
============================== 1 passed in 6.66s ==============================
Error: Error: unsupported status (Running)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:20
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
Maverickzerocommented, May 11, 2021

I’m running version 1.56.0 and I’m getting this error every time I try to run a single test. When I try to “run all tests” it does work. Pytest version is 6.2.2.

3reactions
niccolomineocommented, Apr 22, 2021

Not here, I still have that error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode pytest test discovery fails - python - Stack Overflow
I spent ages trying to decipher this unhelpful error after creating a test that had import errors. Verify that your test suite can...
Read more >
Error: Unable to Start Debugging on the Web Server
When you try to debug an ASP.NET application running on a Web server, you may get this error message: Unable to start debugging...
Read more >
The debugger cannot continue running the process. Operation ...
Click "Continue execution" in the "Break Mode" window; Error Dialog "The debugger cannot continue running the process. Operation not supported.
Read more >
How to Debug Web API Problems in 4 Steps - Kill All Defects
In my experience, the most helpful thing to do is to determine where the error is occurring – if the client is sending...
Read more >
Debugging JTAG - Texas Instruments
This page talks about how to properly debug JTAG connection issues with Texas Instruments XDS Debug Probes by providing a step-by-step ...
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