New submission from Raymond Hettinger <rhettin...@users.sourceforge.net>:

class T(unittest.TestCase):
    def test_items_equal(self):
        # this test fails, but should succeed
        a = [{2,4}, {1,2}]
        b = a[::-1]
        self.assertItemsEqual(a, b)

This method has a fast-path using sorted() and a slow-path that doesn't care 
about cross-type comparisons.  The fast-path is incorrect though and gets the 
wrong answer in the above test case.

----------
assignee: michael.foord
messages: 119960
nosy: michael.foord, rhettinger
priority: high
severity: normal
status: open
title: unittest's assertItemsEqual() method makes too many assumptions about 
its input
versions: Python 2.7, Python 3.2

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

Reply via email to