[issue41322] unittest: Generator test methods will always be marked as passed

2020-07-17 Thread Alexander Hungenberg
New submission from Alexander Hungenberg : The following testcase will always be marked as passed: from unittest import TestCase class BuggyTestCase(TestCase): def test_generator(self): self.assertTrue(False) yield None It happened to us that someone accidentally made

[issue41322] unittest: Generator test methods will always be marked as passed

2020-07-17 Thread Alexander Hungenberg
Alexander Hungenberg added the comment: I would also strongly vote for raising an error if the test method is a generator - not even silently turn it into a list. It would be straight forward to implement various checks (like the ones you mentioned for generators, coroutines, ...) - and