[New-bugs-announce] [issue10602] csv test_register_kwargs has invalid message parameters

Alex Earl report at bugs.python.org
Thu Dec 2 05:38:57 CET 2010

New submission from Alex Earl <slide.o.mix at gmail.com>:

in test_csv.py, the follow test is declared.

def test_register_kwargs(self):
    name = 'fedcba'
    csv.register_dialect(name, delimiter=';')
        self.assertTrue(csv.get_dialect(name).delimiter, '\t')
        self.assertTrue(list(csv.reader('X;Y;Z', name)), ['X', 'Y', 'Z'])

The assertTrue method take an expression to test for "true" and a message to display if that expression is false. If the test's goal is to test that delimiter is set so it's not None, then it will output a tab if the test fails. On the second line, the list would be displayed if the list returned from the reader is an empty list. The result of the reader operation is not the list on the right side anyway.

>>> list(csv.reader('X;Y;Z', name))
[['X'], ['', ''], ['Y'], ['', ''], ['Z']]

messages: 123055
nosy: Alex.Earl
priority: normal
severity: normal
status: open
title: csv test_register_kwargs has invalid message parameters
type: behavior
versions: Python 2.6, Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list