[Python-modules-team] Bug#977097: sphinx-argparse FTBFS with pytest 6
Christian Kastner
ckk at debian.org
Thu Dec 10 20:39:05 GMT 2020
Source: sphinx-argparse
Version: 0.2.2-3
Severity: important
User: pytest at packages.debian.org
Usertags: pytest-v6
Hi,
sphinx-argparse FTBFS with pytest 6 in experimental. The pytest
changelog may offer clues as to why:
https://docs.pytest.org/en/stable/changelog.html
The error log below has more details.
> I: pybuild base:232: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_sphinx-argparse/build; python3.9 -m pytest -v
> ============================= test session starts ==============================
> platform linux -- Python 3.9.1, pytest-6.0.2, py-1.9.0, pluggy-0.13.0 -- /usr/bin/python3.9
> cachedir: .pytest_cache
> rootdir: /<<PKGBUILDDIR>>
> collecting ... collected 15 items
>
> test/test_parser.py::test_parse_options PASSED [ 6%]
> test/test_parser.py::test_parse_default PASSED [ 13%]
> test/test_parser.py::test_parse_arg_choices PASSED [ 20%]
> test/test_parser.py::test_parse_opt_choices PASSED [ 26%]
> test/test_parser.py::test_parse_default_skip_default PASSED [ 33%]
> test/test_parser.py::test_parse_positional PASSED [ 40%]
> test/test_parser.py::test_parse_description PASSED [ 46%]
> test/test_parser.py::test_parse_nested FAILED [ 53%]
> test/test_parser.py::test_parse_nested_with_alias FAILED [ 60%]
> test/test_parser.py::test_aliased_traversal FAILED [ 66%]
> test/test_parser.py::test_parse_nested_traversal FAILED [ 73%]
> test/test_parser.py::test_fill_in_default_prog PASSED [ 80%]
> test/test_parser.py::test_string_quoting PASSED [ 86%]
> test/test_parser.py::test_parse_groups PASSED [ 93%]
> test/test_parser.py::test_action_groups_with_subcommands PASSED [100%]
>
> =================================== FAILURES ===================================
> ______________________________ test_parse_nested _______________________________
>
> def test_parse_nested():
> parser = argparse.ArgumentParser()
> parser.add_argument('foo', default=False, help='foo help')
> parser.add_argument('bar', default=False)
>
> subparsers = parser.add_subparsers()
>
> subparser = subparsers.add_parser('install', help='install help')
> subparser.add_argument('ref', type=str, help='foo1 help')
> subparser.add_argument('--upgrade', action='store_true', default=False, help='foo2 help')
>
> data = parse_parser(parser)
>
> assert data['action_groups'][0]['options'] == [
> {
> 'name': ['foo'],
> 'help': 'foo help',
> 'default': False
> }, {
> 'name': ['bar'],
> 'help': '',
> 'default': False
> }
> ]
>
>> assert data['children'] == [
> {
> 'name': 'install',
> 'help': 'install help',
> 'usage': 'usage: pytest.py install [-h] [--upgrade] ref',
> 'bare_usage': 'pytest.py install [-h] [--upgrade] ref',
> 'action_groups': [
> {
> 'title': 'Positional Arguments',
> 'description': None,
> 'options': [
> {
> 'name': ['ref'],
> 'help': 'foo1 help',
> 'default': None
> }
> ]
> },
> {
> 'description': None,
> 'title': 'Named Arguments',
> 'options': [
> {
> 'name': ['--upgrade'],
> 'default': False,
> 'help': 'foo2 help'
> }
> ]
> }
> ]
> }
> ]
> E AssertionError: assert [{'action_gro...nstall', ...}] == [{'action_gro...nstall', ...}]
> E At index 0 diff: {'name': 'install', 'help': 'install help', 'usage': 'usage: __main__.py install [-h] [--upgrade] ref', 'bare_usage': '__main__.py install [-h] [--upgrade] ref', 'action_groups': [{'title': 'Positional Arguments', 'description': None, 'options': [{'name': ['ref'], 'default': None, 'help': 'foo1 help'}]}, {'title': 'Named Arguments', 'description': None, 'options': [{'name': ['--upgrade'], 'default': False, 'help': 'foo2 help'}]}]} != {'name': 'install', 'help': 'install help', 'usage': 'usage: pytest.py install [-h] [--upgrade] ref', 'bare_usage': 'pyte...
> E
> E ...Full output truncated (24 lines hidden), use '-vv' to show
>
> test/test_parser.py:157: AssertionError
> _________________________ test_parse_nested_with_alias _________________________
>
> def test_parse_nested_with_alias():
> parser = argparse.ArgumentParser()
> parser.add_argument('foo', default=False, help='foo help')
> parser.add_argument('bar', default=False)
>
> subparsers = parser.add_subparsers()
>
> subparser = subparsers.add_parser('install', aliases=['i'], help='install help')
> subparser.add_argument('ref', type=str, help='foo1 help')
> subparser.add_argument('--upgrade', action='store_true', default=False, help='foo2 help')
>
> data = parse_parser(parser)
>
> assert data['action_groups'][0]['options'] == [
> {
> 'name': ['foo'],
> 'help': 'foo help',
> 'default': False
> }, {
> 'name': ['bar'],
> 'help': '',
> 'default': False
> }
> ]
>
>> assert data['children'] == [
> {
> 'name': 'install (i)',
> 'identifier': 'install',
> 'help': 'install help',
> 'usage': 'usage: pytest.py install [-h] [--upgrade] ref',
> 'bare_usage': 'pytest.py install [-h] [--upgrade] ref',
> 'action_groups': [
> {
> 'title': 'Positional Arguments',
> 'description': None,
> 'options': [
> {
> 'name': ['ref'],
> 'help': 'foo1 help',
> 'default': None
> }
> ]
> },
> {
> 'description': None,
> 'title': 'Named Arguments',
> 'options': [
> {
> 'name': ['--upgrade'],
> 'default': False,
> 'help': 'foo2 help'
> }
> ]
> }
> ]
> }
> ]
> E AssertionError: assert [{'action_gro...nstall', ...}] == [{'action_gro...nstall', ...}]
> E At index 0 diff: {'name': 'install (i)', 'help': 'install help', 'usage': 'usage: __main__.py install [-h] [--upgrade] ref', 'bare_usage': '__main__.py install [-h] [--upgrade] ref', 'identifier': 'install', 'action_groups': [{'title': 'Positional Arguments', 'description': None, 'options': [{'name': ['ref'], 'default': None, 'help': 'foo1 help'}]}, {'title': 'Named Arguments', 'description': None, 'options': [{'name': ['--upgrade'], 'default': False, 'help': 'foo2 help'}]}]} != {'name': 'install (i)', 'identifier': 'install', 'help': 'install help', 'usage': 'usage: py...
> E
> E ...Full output truncated (25 lines hidden), use '-vv' to show
>
> test/test_parser.py:217: AssertionError
> ____________________________ test_aliased_traversal ____________________________
>
> def test_aliased_traversal():
> parser = argparse.ArgumentParser()
>
> subparsers1 = parser.add_subparsers()
> subparsers1.add_parser('level1', aliases=['l1'])
>
> data = parse_parser(parser)
>
> data2 = parser_navigate(data, 'level1')
>
>> assert(data2 == {
> 'bare_usage': 'pytest.py level1 [-h]',
> 'help': '',
> 'usage': 'usage: pytest.py level1 [-h]',
> 'name': 'level1 (l1)',
> 'identifier': 'level1'})
> E AssertionError: assert {'bare_usage'...l1 (l1)', ...} == {'bare_usage'...l1 (l1)', ...}
> E Omitting 3 identical items, use -vv to show
> E Differing items:
> E {'usage': 'usage: __main__.py level1 [-h]'} != {'usage': 'usage: pytest.py level1 [-h]'}
> E {'bare_usage': '__main__.py level1 [-h]'} != {'bare_usage': 'pytest.py level1 [-h]'}
> E Full diff:
> E {
> E - 'bare_usage': 'pytest.py level1 [-h]',...
> E
> E ...Full output truncated (12 lines hidden), use '-vv' to show
>
> test/test_parser.py:261: AssertionError
> _________________________ test_parse_nested_traversal __________________________
>
> def test_parse_nested_traversal():
> parser = argparse.ArgumentParser()
>
> subparsers1 = parser.add_subparsers()
> subparser1 = subparsers1.add_parser('level1')
>
> subparsers2 = subparser1.add_subparsers()
> subparser2 = subparsers2.add_parser('level2')
>
> subparsers3 = subparser2.add_subparsers()
> subparser3 = subparsers3.add_parser('level3')
>
> subparser3.add_argument('foo', help='foo help')
> subparser3.add_argument('bar')
>
> data = parse_parser(parser)
>
> data3 = parser_navigate(data, 'level1 level2 level3')
>
> assert data3['action_groups'][0]['options'] == [
> {
> 'name': ['foo'],
> 'help': 'foo help',
> 'default': None
> }, {
> 'name': ['bar'],
> 'help': '',
> 'default': None
> }
> ]
>
> data2 = parser_navigate(data, 'level1 level2')
>> assert data2['children'] == [
> {
> 'name': 'level3',
> 'help': '',
> 'usage': 'usage: pytest.py level1 level2 level3 [-h] foo bar',
> 'bare_usage': 'pytest.py level1 level2 level3 [-h] foo bar',
> 'action_groups': [
> {
> 'title': 'Positional Arguments',
> 'description': None,
> 'options': [
> {
> 'default': None,
> 'name': ['foo'],
> 'help': 'foo help'
> }, {
> 'name': ['bar'],
> 'help': '',
> 'default': None
> }
> ]
> }
> ]
> }
> ]
> E AssertionError: assert [{'action_gro...level3', ...}] == [{'action_gro...level3', ...}]
> E At index 0 diff: {'name': 'level3', 'help': '', 'usage': 'usage: __main__.py level1 level2 level3 [-h] foo bar', 'bare_usage': '__main__.py level1 level2 level3 [-h] foo bar', 'action_groups': [{'title': 'Positional Arguments', 'description': None, 'options': [{'name': ['foo'], 'default': None, 'help': 'foo help'}, {'name': ['bar'], 'default': None, 'help': ''}]}]} != {'name': 'level3', 'help': '', 'usage': 'usage: pytest.py level1 level2 level3 [-h] foo bar', 'bare_usage': 'pytest.py level1 level2 level3 [-h] foo bar', 'action_groups': [{'title': 'Positional Arguments'...
> E
> E ...Full output truncated (22 lines hidden), use '-vv' to show
>
> test/test_parser.py:301: AssertionError
> =============================== warnings summary ===============================
> sphinxarg/parser.py:13
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_sphinx-argparse/build/sphinxarg/parser.py:13: DeprecationWarning: invalid escape sequence \s
> path = re.split('\s+', path)
>
> -- Docs: https://docs.pytest.org/en/stable/warnings.html
> =========================== short test summary info ============================
> FAILED test/test_parser.py::test_parse_nested - AssertionError: assert [{'act...
> FAILED test/test_parser.py::test_parse_nested_with_alias - AssertionError: as...
> FAILED test/test_parser.py::test_aliased_traversal - AssertionError: assert {...
> FAILED test/test_parser.py::test_parse_nested_traversal - AssertionError: ass...
> =================== 4 failed, 11 passed, 1 warning in 0.07s ====================
> E: pybuild pybuild:353: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_sphinx-argparse/build; python3.9 -m pytest -v
> dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.9 returned exit code 13
> make: *** [debian/rules:7: build] Error 25
> dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
More information about the Python-modules-team
mailing list