SystemExit while debugging unit test method
See original GitHub issueEnvironment 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:
- Open command palette
- Run
Python: Debug unit test method...
- Choose a method to run
Logs
Output for Python
in the Output
panel (View
→Output
, 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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:14 (6 by maintainers)
Top Results From Across the Web
In Python unittest, SystemExit: False printed even though ...
When run, this program prints True as expected. Next, I'd like to convert this script into a unittest . I made the following...
Read more >Unit test with System.exit(); — oracle-tech
So I have a Launcher class that gets called by a shell script and then does some stuff. All errors are caught and...
Read more >How Python SystemExit Work with Examples
In Python, SystemExit is an exception that is raised by the sys.exit() method. In general, all exceptions must be derived from BaseException which...
Read more >Testing sys.exit() with pytest - Python Pandemonium
sys.exit will raise exception called SystemExit , which is NOT inherited from Exception class ( Exception and SystemExit both inherited from BaseException )....
Read more >Debug unit tests with Test Explorer - Visual Studio (Windows)
Because test methods can run in any order, set breakpoints in all the test methods that you want to debug. In Test Explorer,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. The fix is in master.
FYI, the fix was merged into PTVSD yesterday morning. @karthiknadig, we’re good to go, right?