[New-bugs-announce] [issue9554] test_argparse.py: use new unittest features

Denver Coneybeare report at bugs.python.org
Tue Aug 10 04:53:47 CEST 2010


New submission from Denver Coneybeare <denver.coneybeare at gmail.com>:

Some of the unit testing code in test_argparse.py could be modified to take advantage of the new unittest features in Python 2.7 and 3.x.  My suggested changes are attached in the patch file test_argparse.py.unittest2.patch

One big one is that assertEquals() now prints a "diff" when multi-line strings compare unequal, so the manual "diffing" logic from the unit tests can be removed.  Also, assertIsNone() is slightly better than assertEquals(None, x).  Finally, there is a tiny fix where parse_args() was expected to throw ArgumentParserError but the test would not fail if it threw no exceptions.

----------
components: Tests
files: test_argparse.py.unittest2.patch
keywords: patch
messages: 113505
nosy: benjamin.peterson, bethard, denversc, eric.smith
priority: normal
severity: normal
status: open
title: test_argparse.py: use new unittest features
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file18463/test_argparse.py.unittest2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9554>
_______________________________________


More information about the New-bugs-announce mailing list