[issue10273] Clean-up Unittest API

Ezio Melotti report at bugs.python.org
Thu Nov 4 01:27:04 CET 2010

Ezio Melotti <ezio.melotti at gmail.com> added the comment:

An alternative would be adding check_order and check_duplicates to assertSameElements and de-deprecate it.

Python 2.7 could be left unchanged because it's too late to add/rename/deprecate methods (it has assertItemsEqual but not assertSameElements). Py3.2 would also be unchanged (assertItemsEqual and the deprecation of assertSameElements are both new in 3.2, assertSameElements has been introduced in 3.1).
They would end up with two different methods though.

The assertSameElements name seems quite good, and providing extra args will make it more flexible (it will cover all the 4 cases listed in msg100685) and the behavior would be clear without clumsy method names.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list