Skip to content

Commit 4eeb475

Browse files
committed
avoid tearDown and cleanup for unittest debugging
1 parent 8593bb1 commit 4eeb475

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

_pytest/unittest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,12 @@ def stopTest(self, testcase):
150150
pass
151151

152152
def runtest(self):
153-
self._testcase(result=self)
153+
if self.config.pluginmanager.get_plugin("pdbinvoke") is None:
154+
self._testcase(result=self)
155+
else:
156+
# disables tearDown and cleanups for post mortem debugging
157+
self._testcase.debug()
158+
154159

155160
def _prunetraceback(self, excinfo):
156161
pytest.Function._prunetraceback(self, excinfo)

0 commit comments

Comments
 (0)