[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: normal
severity: normal
status: open
title: unittest assertLessEqual not working properly with lists
versions: Python 3.4
Added file: http://bugs.python.org/file41081/example.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

--
nosy: +ezio.melotti
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com