Skip to content

Escape pytest in zsh terminal when debuging the tests #4911

@cranechu

Description

@cranechu

Environment data

  • VS Code version: 1.32.3
  • Extension version (available under the Extensions sidebar): 2019.2.5558
  • OS and version: Fedora 29
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.2 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: N/A

Expected behaviour

Debug parameterized pytest by click the "bug" logo in the test tree view, the debugger should start.

Actual behaviour

Debug parameterized pytest (e.g. test_qpair_different_size[5] below), but cannot find the test.
For normal pytest cases, the debug just works, e.g. test_create_device_invalid below.

Steps to reproduce:

  1. launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "debug pynvme script",
            "type": "python",
            "request": "test",
            "console": "integratedTerminal", 
            "sudo": true
        }
    ]
}

Logs

~/pynvme▶ cd /home/cranechu/pynvme ; env PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 sudo /usr/bin/python3 /home/cranechu/.vscode/extensions/ms-python.python-2019.2.5558/pythonFiles/ptvsd_launcher.py --default --client --host localhost --port 40837 /home/cranechu/.vscode/extensions/ms-python.python-2019.2.5558/pythonFiles/testlauncher.py /home/cranechu/pynvme pytest --junitxml=/tmp/tmp-3191CZSiAJnJWSOU.xml --pciaddr=01:00.0 driver_test.py::test_qpair_different_size[5] 
zsh: no matches found: driver_test.py::test_qpair_different_size[5]

~/pynvme▶ cd /home/cranechu/pynvme ; env PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 sudo /usr/bin/python3 /home/cranechu/.vscode/extensions/ms-python.python-2019.2.5558/pythonFiles/ptvsd_launcher.py --default --client --host localhost --port 38197 /home/cranechu/.vscode/extensions/ms-python.python-2019.2.5558/pythonFiles/testlauncher.py /home/cranechu/pynvme pytest --junitxml=/tmp/tmp-3191X7ih17lf4bBg.xml --pciaddr=01:00.0 driver_test.py::test_create_device_invalid 
pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/cranechu/pynvme/scripts/test_nvme_spec.py (will have no effect)
================================== test session starts ==================================
platform linux -- Python 3.7.2, pytest-4.1.1, py-1.7.0, pluggy-0.8.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/cranechu/pynvme, inifile: pytest.ini
plugins: cov-2.6.1
collected 1 item    
...

Metadata

Metadata

Assignees

Labels

area-debuggingarea-testingbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from posterneeds PRReady to be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions