[issue19645] decouple unittest assertions from the TestCase class

Pascal Chambon report at bugs.python.org
Thu Jun 13 05:50:01 EDT 2019


Pascal Chambon <chambon.pascal at gmail.com> added the comment:

I don't get it, why would failureException block anything ? The unittest.TestCase API must remain the same anyway, but it could become just a wrapper towards external assertions.

For example :

class TestCase:

   assertEqual = wrap(assertions.assert_equal)

Where "wrap" for example is some kind of functools.partial() injecting into external assertions a parameter "failure_exception_class". Having all these external assertions take such a parameter (defaulting to AssertionError) would be a great plus for adaptability anyway.

----------
versions: +Python 3.5 -Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19645>
_______________________________________


More information about the Python-bugs-list mailing list