bpo-34900: Make TestCase.debug() work with subtests (GH-9707)
(cherry picked from commit da2bf9f66d0c95b988c5d87646d168f65499b316)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index c0170d1..758924d 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -519,7 +519,7 @@
case as failed but resumes execution at the end of the enclosed
block, allowing further test code to be executed.
"""
- if not self._outcome.result_supports_subtests:
+ if self._outcome is None or not self._outcome.result_supports_subtests:
yield
return
parent = self._subtest