New submission from Jason Vas Dias <jason.vas.d...@gmail.com>:

Hi - I've been experiencing many errors trying to build any version
of Python that will pass its test suite - see issues : #11946 , #11954 -
and now I've been advised to raise bugs about each test failure -
hence this bug. For details of my config and build procedure, please
see : issue #11954 .

So, running the new ./python fails test_argparse :

$ LD_LIBRARY_PATH=`pwd` LD_PRELINK=`pwd`/libpython3.3.so.1.0 \
  ./python /usr/src/cpython/Lib/test/test_argparse.py
...
======================================================================
FAIL: test_failures_many_groups_listargs (__main__.TestFileTypeW)     
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 216, in wrapper
    test_func(self)                                                      
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 235, in test_failures
    raises(ArgumentParserError, parser.parse_args, args)                       
AssertionError: ArgumentParserError not raised by parse_args                   

======================================================================
FAIL: test_failures_many_groups_sysargs (__main__.TestFileTypeW)      
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 216, in wrapper
    test_func(self)                                                      
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 235, in test_failures
    raises(ArgumentParserError, parser.parse_args, args)                       
AssertionError: ArgumentParserError not raised by parse_args                   

======================================================================
FAIL: test_failures_no_groups_listargs (__main__.TestFileTypeW)       
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 216, in wrapper
    test_func(self)                                                      
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 235, in test_failures
    raises(ArgumentParserError, parser.parse_args, args)                       
AssertionError: ArgumentParserError not raised by parse_args                   

======================================================================
FAIL: test_failures_no_groups_sysargs (__main__.TestFileTypeW)        
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 216, in wrapper
    test_func(self)                                                      
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 235, in test_failures
    raises(ArgumentParserError, parser.parse_args, args)                       
AssertionError: ArgumentParserError not raised by parse_args                   

======================================================================
FAIL: test_failures_one_group_listargs (__main__.TestFileTypeW)       
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 216, in wrapper
    test_func(self)                                                      
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 235, in test_failures
    raises(ArgumentParserError, parser.parse_args, args)                       
AssertionError: ArgumentParserError not raised by parse_args                   

======================================================================
FAIL: test_failures_one_group_sysargs (__main__.TestFileTypeW)        
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 216, in wrapper
    test_func(self)                                                      
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 235, in test_failures
    raises(ArgumentParserError, parser.parse_args, args)                       
AssertionError: ArgumentParserError not raised by parse_args                   

----------------------------------------------------------------------
Ran 1608 tests in 5.293s                                              

FAILED (failures=6)
Traceback (most recent call last):
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 4712, in <module>
    test_main()                                                            
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 4704, in test_main
    support.run_unittest(__name__)                                          
  File "/usr/src/cpython/Lib/test/support.py", line 1208, in run_unittest   
    _run_suite(suite)                                                       
  File "/usr/src/cpython/Lib/test/support.py", line 1191, in _run_suite     
    raise TestFailed(err)                                                   
test.support.TestFailed: multiple errors occurred 


Now, as someone with not too recent python programming experience,
I find it very difficult to understand exactly what is being
tested by :

class TestFileTypeW(TempDirMixin, ParserTestCase):
    """Test the FileType option/argument type for writing files"""

    def setUp(self):
        super(TestFileTypeW, self).setUp()
        self.create_readonly_file('readonly')

    argument_signatures = [
        Sig('-x', type=argparse.FileType('w')),
        Sig('spam', type=argparse.FileType('w')),
    ]
    failures = ['-x', '', 'readonly']
    successes = [
        ('foo', NS(x=None, spam=WFile('foo'))),
        ('-x foo bar', NS(x=WFile('foo'), spam=WFile('bar'))),
        ('bar -x foo', NS(x=WFile('foo'), spam=WFile('bar'))),
        ('-x - -', NS(x=sys.stdout, spam=sys.stdout)),
    ]


But it seems at least one bug is self-evident : test_argparse.py's
error messages are essentially meaningless, and contain no useful
information (beyond the name) about what failed or why - they are
all essentially duplicates of :

Traceback (most recent call last):
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 216, in wrapper
    test_func(self)
  File "/usr/src/cpython/Lib/test/test_argparse.py", line 235, in test_failures
    raises(ArgumentParserError, parser.parse_args, args)

So why emit 6 copies of the same meaningless message ? 

I'm curious: how do you expect those error messages to help people
track down the source of the bug when every error message contains
the same data and line numbers, and they are line numbers not
of specific tests, but of some "error handler" routine ?

----------
components: Build
messages: 134779
nosy: Jason.Vas.Dias
priority: normal
severity: normal
status: open
title: 3.3 : test_argparse.py fails 'make test'
type: crash
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11955>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to