Closed
Description
Running test_argparse with option -We
fails:
$ ./python -We -m test -vuall test_argparse -m test_invalid_args
...
======================================================================
ERROR: test_invalid_args (test.test_argparse.TestIntermixedArgs.test_invalid_args)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/test/test_argparse.py", line 5815, in test_invalid_args
parser.parse_intermixed_args(['hello', '--foo'])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/serhiy/py/cpython/Lib/argparse.py", line 2386, in parse_intermixed_args
args, argv = self.parse_known_intermixed_args(args, namespace)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/serhiy/py/cpython/Lib/argparse.py", line 2440, in parse_known_intermixed_args
warn('Do not expect %s in %s' % (action.dest, namespace))
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UserWarning: Do not expect foo in Namespace(foo=[])
----------------------------------------------------------------------
The test was added in gh-103558. cc @gaogaotiantian
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Doc issues