Debugging unittest tests doesn't work
See original GitHub issueFrom @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
Issue Analytics
- State:
- Created 6 years ago
- Comments:27 (1 by maintainers)
Top Results From Across the Web
Visual Studio - suddenly cannot debug tests - Stack Overflow
I tried to debug tests using Resharper 8 Unit Test Session window. The message in the result window was "Test wasn't run".
Read more >Can't run or debug unit tests - Visual Studio Feedback
I'm using Visual Studio Community Edition 15.8.1 and I can't run or debug any unit tests. Every time I'm trying to run the...
Read more >Debugging unit tests in VS 2012 doesn't work - MSDN
As my understanding, if we want to debug a unit test, we could debug it like the following steps. Right click a unit...
Read more >MSTest Unit Testing does not work (or fails with error) with ...
+1 can't debug unit tests. They can be executed but not debugged. VS Professional 2017 (15.3.1) Re-sharper Ultimate (2017.1.3).
Read more >Debugging Your Unit Test Suite in Python | Capital One
Python has a reputation as being a simple language to work in, but that doesn't always extend to the unit tests; some things...
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
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