remove coupling between unittest and assertions

Hi, I would seperate unittest from its assertions. I suggest to create the module "assertions" in stdlib. - it will not change unittest api - it improves decoupling and SOC so other testing library will be able to share a common base code avoiding duplication - it would be great to write guard clauses with more expressive error message like that for example: from assertions import assert_in def my_function(*args, **kwargs): assert_in(''option", kwargs) ... This last point merits more reflexion since "assert" is removed when python compiles in optimize mode. A such mecanism can be added further in assertions lib.

On 15 November 2013 17:55, Gregory Salvan <apieum@gmail.com> wrote:
We've (very briefly) discussed the idea of decoupling the APIs in http://bugs.python.org/issue18054 (the specific proposal mentioned there was to standardise the "matcher" concept used in testtools). I'd certainly like to see something along those lines in Python 3.5 - having good assertions independent of the assert statement and the unittest object model would be helpful (although it may still be a submodule of unittest). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

On 15 November 2013 17:55, Gregory Salvan <apieum@gmail.com> wrote:
We've (very briefly) discussed the idea of decoupling the APIs in http://bugs.python.org/issue18054 (the specific proposal mentioned there was to standardise the "matcher" concept used in testtools). I'd certainly like to see something along those lines in Python 3.5 - having good assertions independent of the assert statement and the unittest object model would be helpful (although it may still be a submodule of unittest). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
participants (2)
-
Gregory Salvan
-
Nick Coghlan