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 rsk2
Recipients rsk2
Date 2021-03-22.16:16:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616429766.92.0.297524624601.issue43596@roundup.psfhosted.org>
In-reply-to
Content
Right now, this code:

    class FooError(Exception): pass
    class BarError(Exception): pass

    def test_me(self):
      with self.assertRaises(FooError):
        raise BarError("something")

will have the error "BarError: something" with no indication that an exception was expected but just that we got the wrong one.

It would be help to change the message to something like:

  Expected exception of type FooError but exception BarError('something') was raised.
History
Date User Action Args
2021-03-22 16:16:06rsk2setrecipients: + rsk2
2021-03-22 16:16:06rsk2setmessageid: <1616429766.92.0.297524624601.issue43596@roundup.psfhosted.org>
2021-03-22 16:16:06rsk2linkissue43596 messages
2021-03-22 16:16:06rsk2create