[issue25673] unittest assertLessEqual not working properly with lists

2015-11-19 Thread kehlert
New submission from kehlert: I attached a file that explains the issue. Basically, assertLessEqual only seems to compare the first elements of the two lists and ignores the others. Thus a test can pass when it shouldn't. -- files: example.py messages: 254920 nosy: kehlert priority:

[issue25673] unittest assertLessEqual not working properly with lists

2015-11-19 Thread Ezio Melotti
Ezio Melotti added the comment: This is how comparison works for sequences and it's not a bug: >>> a = [1, 2] >>> b = [2, 1] >>> a <= b True >>> a = [2, 1] >>> b = [1, 2] >>> a <= b False See https://docs.python.org/3/tutorial/datastructures.html#comparing-sequences-and-other-types