Author Kit Choi
Recipients Kit Choi
Date 2019-09-27.17:26:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I expect the following test to fail, because an "error" is not a "failure".
Unexpectedly, the test passes:

class TestFailure(unittest.TestCase):

    def test_expected_failure(self):
        raise TypeError()   # for example, a typo.

$ python -m unittest test_main
Ran 1 test in 0.000s

OK (expected failures=1)

This behaviour exists since Python 2.7, and is still true for the Python 3.8.0b1
Date User Action Args
2019-09-27 17:26:09Kit Choisetrecipients: + Kit Choi
2019-09-27 17:26:09Kit Choisetmessageid: <>
2019-09-27 17:26:09Kit Choilinkissue38296 messages
2019-09-27 17:26:09Kit Choicreate