[issue15810] assertSequenceEqual should be fired when comparing sequences

2012-08-29 Thread Florent Xicluna

New submission from Florent Xicluna:

When writing unittest, I noticed that I need to uses assertSequenceEqual 
explicitly when comparing sequences of different kinds.

If I only use the plain assertEqual, it does not generate pretty diffs.

On second thought, I think it could be fixed in unittest to use 
assertSequenceEqual when isinstance(arg, (tuple, list)) or isinstance(arg, 
collections.Sequence) is True.

--
components: Library (Lib), Tests
messages: 169372
nosy: flox
priority: normal
severity: normal
status: open
title: assertSequenceEqual should be fired when comparing sequences
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15810
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15810] assertSequenceEqual should be fired when comparing sequences

2012-08-29 Thread R. David Murray

R. David Murray added the comment:

I think it works as it should (you shouldn't be asserting that a sequence and a 
tuple are equal, after all).  Once you fix your test, you'll get the pretty 
print if there are still differences.

--
nosy: +michael.foord, r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15810
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15810] assertSequenceEqual should be fired when comparing sequences

2012-08-29 Thread Florent Xicluna

Florent Xicluna added the comment:

you're probably right.
I will continue to use assertSequenceEqual for my use cases.
Actually, what confused me is that these assertions are True:


class T(tuple): pass
class L(list): pass

assertEqual(T('ab'), tuple('ab'))
assertEqual(L('ab'), list('ab'))

And when these tests fail, the output is not pretty formatted.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15810
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com