[issue43596] change assertRaises message when wrong exception is raised

2021-08-01 Thread Irit Katriel
Irit Katriel added the comment: I agree. That’s what the “usually” was for. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue43596] change assertRaises message when wrong exception is raised

2021-08-01 Thread Mark Dickinson
Mark Dickinson added the comment: I think I understand where the request comes from: in the case where you've changed the exception type that an API is expected to raise, and you've either updated the test to check for the new exception type and missed an update in the business logic, or vic

[issue43596] change assertRaises message when wrong exception is raised

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Irit. The test is failed in any case, so you need to look at the code to fix it. For the same reason we do not have assertNotRaises(). -- nosy: +serhiy.storchaka ___ Python tracker

[issue43596] change assertRaises message when wrong exception is raised

2021-08-01 Thread Irit Katriel
Irit Katriel added the comment: Another way to look at it is that your test has two problems. One is that the expected exception didn’t happen and the other is that an unexpected exception happened. The two problems are usually unrelated, and trying to conflate them into one error message c

[issue43596] change assertRaises message when wrong exception is raised

2021-07-29 Thread Irit Katriel
Change by Irit Katriel : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue43596] change assertRaises message when wrong exception is raised

2021-07-29 Thread Irit Katriel
Irit Katriel added the comment: What you are suggesting replaces the type of the exception being raised. If it's something like a MemoryError or KeyboardInterrupt you don't want that, you want your test process to terminate. -- nosy: +iritkatriel

[issue43596] change assertRaises message when wrong exception is raised

2021-03-22 Thread Kamil Turek
Change by Kamil Turek : -- nosy: +kamilturek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue43596] change assertRaises message when wrong exception is raised

2021-03-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue43596] change assertRaises message when wrong exception is raised

2021-03-22 Thread Nathaniel Manista
Change by Nathaniel Manista : -- nosy: +Nathaniel Manista ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue43596] change assertRaises message when wrong exception is raised

2021-03-22 Thread R. Samuel Klatchko
New submission from R. Samuel Klatchko : 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 indicatio