Skip to content

Debugging tests is returning errors due to "unsupported status"  #15736

@luabud

Description

@luabud

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-testingbugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityneeds spikeLabel for issues that need investigation before they can be worked on.regressionBug didn't exist in a previous releaseverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions