You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2018-10-12.11:09:21.672>created_at=<Date2018-10-04.22:24:33.818>labels= ['3.7', '3.8', 'type-bug', 'library']
title='unittest subTests() fails when called from debug()'updated_at=<Date2018-10-12.11:09:21.672>user='https://github.com/nicoddemus'
This works when executed, but if we change tc.run() to tc.debug() we get the following exception:
Traceback (most recent call last):
File ".tmp\test-unittest-regression.py", line 13, in<module>
File "C:\Users\Bruno\AppData\Local\Programs\Python\Python36\lib\unittest\case.py", line 658, in debug
File ".tmp\test-unittest-regression.py", line 7, in test_subtest
File "C:\Users\Bruno\AppData\Local\Programs\Python\Python36\lib\contextlib.py", line 81, in__enter__returnnext(self.gen)
File "C:\Users\Bruno\AppData\Local\Programs\Python\Python36\lib\unittest\case.py", line 512, in subTest
AttributeError: 'NoneType'object has no attribute 'result_supports_subtests'
Looking at the code, subTest assumes that the TestCase instance has the self._outcome atribute, which is set only by run().
FYI, I just noticed that this is a duplicate of bpo-29551, but decided to keep this one open.
OK thanks. I did try to search for open issues before filing this one by using the "subtest result_supports_subtests" terms, as I figured a bug report would include the traceback, that's why I didn't find 29551, heh.