New submission from Facundo Batista <facu...@taniquetil.com.ar>:

Sometimes it's nice to do extra checks on the error raised and captured by 
self.assertRaises call.

Yes, the same can be achieved using assertRaises as a context manager and then 
accessing the `exception` attribute in the context manager, but it looks too 
cumbersome to just get the exception, when it can be simply returned by the 
assertRaises call.

Note 1: Currently it returns None, so no backward compatibility problem.

Note 2: assertRaises in testtools does this and is very useful

----------
messages: 309414
nosy: facundobatista
priority: normal
severity: normal
stage: needs patch
status: open
title: assertRaises should return the "captured" exception
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32487>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to