Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12.3: Test suite fails #483

Closed
rikardg opened this issue Apr 13, 2024 · 1 comment
Closed

Python 3.12.3: Test suite fails #483

rikardg opened this issue Apr 13, 2024 · 1 comment

Comments

@rikardg
Copy link

rikardg commented Apr 13, 2024

It looks like the test suite starts failing with Python 3.12.3 (it passes just fine with 3.12.2 here).

The errors look identical to the ones reported in #480.

Results from `python3 test/test.py -vv`
======================================================================
ERROR: test_repl_parse_after_complete (__main__.TestArgcompleteREPL.test_repl_parse_after_complete)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 934, in test_repl_parse_after_complete
    args = p.parse_args(["--foo", "spam", "bar"])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/.local/share/mise/installs/python/3.12.3/lib/python3.12/argparse.py", line 1896, in parse_args
    args, argv = self.parse_known_args(args, namespace)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/.local/share/mise/installs/python/3.12.3/lib/python3.12/argparse.py", line 1929, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/argcomplete/argcomplete/packages/_argparse.py", line 299, in _parse_known_args
    start_index = consume_optional(start_index)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/argcomplete/argcomplete/packages/_argparse.py", line 165, in consume_optional
    action, option_string, explicit_arg = option_tuple
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)

======================================================================
FAIL: test_choices (__main__.TestArgcomplete.test_choices)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 179, in test_choices
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'--ship'
'-h'
'--help'
Items in the second set but not the first:
'speedboat'
'submarine'

======================================================================
FAIL: test_completers (__main__.TestArgcomplete.test_completers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 300, in test_completers
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'-h'
'--url'
'--help'
'--email'
Items in the second set but not the first:
'http://url1'
'http://url2'

======================================================================
FAIL: test_default_completer (__main__.TestArgcomplete.test_default_completer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 424, in test_default_completer
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'--one'
'--many'
Items in the second set but not the first:
'test/'

======================================================================
FAIL: test_escape_special_chars (__main__.TestArgcomplete.test_escape_special_chars)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 832, in test_escape_special_chars
    self.assertEqual(set(self.run_completer(make_parser(), "prog -1 ")), {r"bar\<\$\>baz "})
AssertionError: Items in the first set but not the second:
'-1'
'-3'
'-2'
Items in the second set but not the first:
'bar\\<\\$\\>baz '

======================================================================
FAIL: test_exclusive (__main__.TestArgcomplete.test_exclusive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 773, in test_exclusive
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'--no-bar'

======================================================================
FAIL: test_exclusive_class (__main__.TestArgcomplete.test_exclusive_class)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 822, in test_exclusive_class
    self.assertEqual(set(self.run_completer(parser, cmd, completer=completer)), set(output))
AssertionError: Items in the first set but not the second:
'--foo'
'--baz'
'--bar'
'--no-bar'
Items in the second set but not the first:
'baz2'
'baz1'

======================================================================
FAIL: test_filescompleter_filetype_integration (__main__.TestArgcomplete.test_filescompleter_filetype_integration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 378, in test_filescompleter_filetype_integration
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'--w'
'-h'
'--r'
'--help'
Items in the second set but not the first:
'abcxyz'
'abcdefж/'
'abcaha/'

======================================================================
FAIL: test_mixed_optional_positional (__main__.TestArgcomplete.test_mixed_optional_positional)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 793, in test_mixed_optional_positional
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'--set'
Items in the second set but not the first:
'name1'
'name2'

======================================================================
FAIL: test_non_ascii (__main__.TestArgcomplete.test_non_ascii)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 482, in test_non_ascii
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'-h'
'--книга'
'--help'
Items in the second set but not the first:
'Понедельник\\ начинается\\ в\\ субботу'
'Трудно\\ быть\\ богом'
'Парень\\ из\\ преисподней'

======================================================================
FAIL: test_optional_nargs (__main__.TestArgcomplete.test_optional_nargs)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 697, in test_optional_nargs
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'--baz'
'--foo'
'-h'
'--bar'
'--help'
'--qux'
'--foobar'
Items in the second set but not the first:
'foo1'
'foo2'

======================================================================
FAIL: test_positional_remainder (__main__.TestArgcomplete.test_positional_remainder)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 717, in test_positional_remainder
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the second set but not the first:
'--opt'
'pos'

======================================================================
FAIL: test_subparser_completers (__main__.TestArgcomplete.test_subparser_completers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 345, in test_subparser_completers
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the second set but not the first:
'val5'

======================================================================
FAIL: test_subparsers (__main__.TestArgcomplete.test_subparsers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/argcomplete/test/test.py", line 451, in test_subparsers
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
AssertionError: Items in the first set but not the second:
'eggs'
'--age'
'spam'
Items in the second set but not the first:
'in\\ the\\ rain'
'on\\ a\\ boat'
'with\\ a\\ goat'
'on\\ a\\ train'

----------------------------------------------------------------------
Ran 186 tests in 217.415s

FAILED (failures=13, errors=1, skipped=12, expected failures=5)
@kislyuk
Copy link
Owner

kislyuk commented Apr 14, 2024

Fix released in v3.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants