vscode-python: Debugging unittest tests doesn't work
From @yRefl3x on March 6, 2017 11:11
Environment data
VS Code version: 1.10.1 Python Extension version: 0.5.9 Python Version: 2.7.5 OS and version: Windows 10
Actual behavior
After clicking on the “Debug Test” lens of a test method, debugging doesn’t start. “Running Tests” is displayed at the bottom of the VSCode window indefinitely.
Expected behavior
Debugging starts.
Steps to reproduce:
I have the following folder structure:
Issue
cool_package
__init__.py
cool_module.py
test
__init__.py
test_cool_module.py
cool_module.py
def foo(a, b):
return a + b
test_cool_module.py
import unittest
from cool_package.cool_module import foo
class TestCoolModule(unittest.TestCase):
def test_foo(self):
res = foo(1, 2)
self.assertEquals(res, 3)
- Set a breakpoint at line
res = foo(1, 2)
- Click “Debug Test” in test method code lens
Settings
settings.json:
{
"python.unitTest.unittestArgs": [
"-v",
"-s",
"test",
"-p",
"test_*.py"
],
"python.unitTest.unittestEnabled": true
}
Logs
Output from Python Test Log
output panel
READY
Copied from original issue: DonJayamanne/pythonVSCode#797
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (1 by maintainers)
Commits related to this issue
- Fix debugging tests (#304) Fixes #89 - Get a random port if the one prescribed is not available - Perform handshake with support for data being streamed — committed to microsoft/vscode-python by deleted user 7 years ago
I think I’m still seeing this issue. Trying to use the inline “Debug Tests” within a unit test module shows “Running Tests” in the status bar, but nothing happens.
Done: https://github.com/Microsoft/vscode-python/issues/1009
From @syagev on March 14, 2017 8:56
Same exact symptoms here. win10, python ext 0.6.0, VSC 1.10.2, Python 3.5.3
EDIT: “reload window” VSC command seems to solve this every time this happens