New submission from Terry J. Reedy <[email protected]>:
(3.1 not checked because it seems not to have test_argparse)
Python 2.7 or 3.2, WinXP these pass:
C:\Programs\Python27>python -m test.regrtest test_argparse
C:\Programs\Python32>python -m test test_argparse
[1/1] test_argparse
1 test OK.
C:\Programs\Python32>python -m test -v test_argparse
C:\Programs\Python32>python -c "from test import test_argparse as t;
t.test_main()"
Ran 1536 tests in 6.188s
OK
but interactively (command window interpreter or IDLE shell, 3.2 or 2.7)
>>> from test import test_argparse as t; t.test_main()
gives two failures related to extra spaces in usage string (I added a couple of
newlines for clarity). I have no idea if problem is with argparse,
test_argparse, regrtest, unittest, or interactive versus batch mode.
======================================================================
FAIL: test_groups_parents (test.test_argparse.TestParentParsers)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Programs\Python32\lib\test\test_argparse.py", line 2217, in
test_groups_parents
'''.format(self.main_program)))
File "C:\Programs\Python32\lib\test\test_argparse.py", line 29, in assertEqual
super(TestCase, self).assertEqual(obj1, obj2)
AssertionError:
'usage: [-h] [-w W] [-x X] [-y Y | -z Z]\n\noptional arguments:\n -h, --help
s [truncated]... !=
'usage: [-h] [-w W] [-x X] [-y Y | -z Z]\n\noptional arguments:\n -h, --help
[truncated]...
- usage: [-h] [-w W] [-x X] [-y Y | -z Z]
+ usage: [-h] [-w W] [-x X] [-y Y | -z Z]
? +
optional arguments:
-h, --help show this help message and exit
-y Y
-z Z
g:
gd
-w W
-x X
======================================================================
FAIL: test_parent_help (test.test_argparse.TestParentParsers)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Programs\Python32\lib\test\test_argparse.py", line 2188, in
test_parent_help
'''.format(self.main_program)))
File "C:\Programs\Python32\lib\test\test_argparse.py", line 29, in assertEqual
super(TestCase, self).assertEqual(obj1, obj2)
AssertionError:
'usage: [-h] [-b B] [--d D] [--w W] [-y Y] a z\n\npositional arguments:\n a\n
[truncated]... !=
'usage: [-h] [-b B] [--d D] [--w W] [-y Y] a z\n\npositional arguments:\n a\n
[truncated]...
- usage: [-h] [-b B] [--d D] [--w W] [-y Y] a z
+ usage: [-h] [-b B] [--d D] [--w W] [-y Y] a z
? +
positional arguments:
a
z
optional arguments:
-h, --help show this help message and exit
-b B
--w W
c:
--d D
x:
-y Y
----------------------------------------------------------------------
Ran 1536 tests in 29.438s
FAILED (failures=2)
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
from test import test_argparse as t; t.test_main()
File "C:\Programs\Python32\lib\test\test_argparse.py", line 4423, in test_main
support.run_unittest(__name__)
File "C:\Programs\Python32\lib\test\support.py", line 1145, in run_unittest
_run_suite(suite)
File "C:\Programs\Python32\lib\test\support.py", line 1128, in _run_suite
raise TestFailed(err)
test.support.TestFailed: multiple errors occurred
----------
components: Library (Lib)
messages: 134259
nosy: bethard, terry.reedy
priority: normal
severity: normal
status: open
title: Test_argparse failure but only in interactive mode
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11906>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com