This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author defreng
Recipients defreng
Date 2020-07-17.09:46:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org>
In-reply-to
Content
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 the test method a generator function. That error was caught very late, because it always appears to have executed correctly.

Maybe an additional check can be introduced in the unittest module, to check if a test_ method was executed correctly?
History
Date User Action Args
2020-07-17 09:46:57defrengsetrecipients: + defreng
2020-07-17 09:46:57defrengsetmessageid: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org>
2020-07-17 09:46:57defrenglinkissue41322 messages
2020-07-17 09:46:56defrengcreate