Skip to content

SystemExit while debugging unit test method #3201

@pniedzwiedzinski

Description

@pniedzwiedzinski

Environment data

  • VS Code version: 1.28.2
  • Extension version (available under the Extensions sidebar): 2018.9.2
  • OS and version: macOS Mojave 10.14
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: pytest 3.6.0

Actual behavior

When I run Debug unit test method... and choosing the test to debug it opens testlauncher.py and shows this message:

Exception has occurred: SystemExit
0
  File "~/.vscode/extensions/ms-python.python-2018.9.2/pythonFiles/experimental/testlauncher.py", line 58, in run
    pass
  File "~/.vscode/extensions/ms-python.python-2018.9.2/pythonFiles/experimental/testlauncher.py", line 64, in <module>
    run(cwd, testRunner, args)

Expected behavior

Start debugging 😄

Steps to reproduce:

  1. Open command palette
  2. Run Python: Debug unit test method...
  3. Choose a method to run

Logs

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

Starting Microsoft Python language server.
##########Linting Output - pylint##########
************* Module testlauncher
23,8,error,E0611:No name 'debugger' in module 'ptvsd'
23,8,error,E0401:Unable to import 'ptvsd.debugger'
26,8,error,E1101:Class 'traceback' has no 'print_exc' member
26,8,error,E0602:Undefined variable 'traceback'
22,8,warning,W0612:Unused variable 'ptvsd'
54,12,error,E0401:Unable to import 'nose'

------------------------------------------------------------------
Your code has been rated at 1.88/10 (previous run: 1.88/10, +0.00)

Microsoft Python Language Server version 0.1.50.0
Initializing for ~/path/to/project/venv/bin/python
##########Linting Output - pylint##########

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

##########Linting Output - pylint##########
************* Module testlauncher
23,8,error,E0611:No name 'debugger' in module 'ptvsd'
23,8,error,E0401:Unable to import 'ptvsd.debugger'
26,8,error,E1101:Class 'traceback' has no 'print_exc' member
26,8,error,E0602:Undefined variable 'traceback'
22,8,warning,W0612:Unused variable 'ptvsd'
54,12,error,E0401:Unable to import 'nose'

------------------------------------------------------------------
Your code has been rated at 1.88/10 (previous run: 1.88/10, +0.00)

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

No output

Metadata

Metadata

Labels

area-debuggingarea-testingbugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priority

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions