[issue15810] assertSequenceEqual should be fired when comparing sequence subclasses

Gregory P. Smith report at bugs.python.org
Fri Aug 31 19:53:58 CEST 2012


Gregory P. Smith added the comment:

When we added this functionality to assertEqual we were *intentionally* conservative on when it would auto-promote to nicer equality comparison functions.  It needs to behave exactly as == would in all situations.

>>> (1,2,3) == [1,2,3]
False

We must maintain that behavior in assertEqual.

Tests should use assertSequenceEqual when they want to compare sequences regardless of type because they are testing for something less than strict equality.

----------
nosy: +gregory.p.smith
resolution:  -> rejected
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15810>
_______________________________________


More information about the Python-bugs-list mailing list