vscode-python: Unittest id parsing fails when using `testscenarios`

Environment data

  • VS Code version: 1.60.2
  • Extension version (available under the Extensions sidebar): v2021.9.1246542782
  • OS and version: Ubuntu 20.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
  • Relevant/affected Python packages and their versions:
  • Relevant/affected Python-related VS Code extensions and their versions:
  • Value of the python.languageServer setting: pylance

[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]

Expected behaviour

Clicking “Run Test” on a test should run it.

Actual behaviour

An error is shown in the Python log and the test is not run (see log below).

Steps to reproduce:

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

  1. Configure tests to use unittest
    "python.testing.unittestEnabled": true,
    "python.testing.unittestArgs": [
        "-s",
        "my.tests.module"
    ],
  1. After discovery, click “Run Test”

Logs

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

> ~/src/helios/.tox/py3/bin/python3 ~/.vscode/extensions/ms-python.python-2021.9.1246542782/pythonFiles/visualstudio_py_testlauncher.py --us=helios.tests --up=test*.py --uvInt=1 --result-port=44367 -thelios.tests.tasks.test_tasks.TestUnlinkCVEsTask.test_ignores_unknown_CVEs --testFile=/home/juledwar/src/helios/helios.tests/helios/tests/tasks/test_tasks.py
cwd: ~/src/helios
Error 2021-10-06 13:48:56: [object Object] [object Object]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 56 (25 by maintainers)

Commits related to this issue

Most upvoted comments

17641-testscenarios.zip image

  1. load the above repo
  2. go to test explorer
  3. make sure the explorer looks like the above screenshot

We are actually having some delays getting the newest changes out due to some other release issues. I will reach out when the changes are on the most recent pre-release and then you should be able to see them on your side. Thanks!