Closed kislyuk closed 1 year ago
I've recently noticed an issue and it's highly likely that it's related to #436.
I get the same failures in Fedora with Python 3.12.0b2 even with(out) https://github.com/kislyuk/argcomplete/pull/436:
=================================== FAILURES ===================================
__________________ TestBashGlobal.test_console_script_module ___________________
self = <test.test.TestBashGlobal testMethod=test_console_script_module>
@unittest.skipIf(os.uname()[0] == "Darwin", "Skip test that fails on MacOS")
def test_console_script_module(self):
"""Test completing a console_script for a module."""
> self._test_console_script()
test/test.py:1293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test.py:1288: in _test_console_script
self.assertEqual(self.sh.run_command(command), 'arg\r\n')
E AssertionError: "usage: test-module [-h] {arg}\r\ntest-mo[66 chars]\r\n" != 'arg\r\n'
E + arg
E - usage: test-module [-h] {arg}
E - test-module: error: argument arg: invalid choice: 'a' (choose from 'arg')
_______________ TestBashGlobal.test_console_script_module_wheel ________________
self = <test.test.TestBashGlobal testMethod=test_console_script_module_wheel>
@unittest.skipIf(os.uname()[0] == "Darwin", "Skip test that fails on MacOS")
def test_console_script_module_wheel(self):
"""Test completing a console_script for a module from a wheel."""
> self._test_console_script(wheel=True)
test/test.py:1303:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test.py:1288: in _test_console_script
self.assertEqual(self.sh.run_command(command), 'arg\r\n')
E AssertionError: "usage: test-module [-h] {arg}\r\ntest-mo[66 chars]\r\n" != 'arg\r\n'
E + arg
E - usage: test-module [-h] {arg}
E - test-module: error: argument arg: invalid choice: 'a' (choose from 'arg')
__________________ TestBashGlobal.test_console_script_package __________________
self = <test.test.TestBashGlobal testMethod=test_console_script_package>
@unittest.skipIf(os.uname()[0] == "Darwin", "Skip test that fails on MacOS")
def test_console_script_package(self):
"""Test completing a console_script for a package."""
> self._test_console_script(package=True)
test/test.py:1298:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test.py:1288: in _test_console_script
self.assertEqual(self.sh.run_command(command), 'arg\r\n')
E AssertionError: "usage: test-package [-h] {arg}\r\ntest-p[68 chars]\r\n" != 'arg\r\n'
E + arg
E - usage: test-package [-h] {arg}
E - test-package: error: argument arg: invalid choice: 'a' (choose from 'arg')
_______________ TestBashGlobal.test_console_script_package_wheel _______________
self = <test.test.TestBashGlobal testMethod=test_console_script_package_wheel>
@unittest.skipIf(os.uname()[0] == "Darwin", "Skip test that fails on MacOS")
def test_console_script_package_wheel(self):
"""Test completing a console_script for a package from a wheel."""
> self._test_console_script(package=True, wheel=True)
test/test.py:1308:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test.py:1288: in _test_console_script
self.assertEqual(self.sh.run_command(command), 'arg\r\n')
E AssertionError: "usage: test-package [-h] {arg}\r\ntest-p[68 chars]\r\n" != 'arg\r\n'
E + arg
E - usage: test-package [-h] {arg}
E - test-package: error: argument arg: invalid choice: 'a' (choose from 'arg')
@hroncok that looks like pytest output. Is that right?
OK, I'm fairly certain the output you pasted above is from Pytest @hroncok .
Please respect the maintainers' time and refrain from posting bug reports in this project based on test failures in pytest. This package's default configuration provides for running tests using unittest, and only test failures in unittest should be considered. While pytest's unittest emulation is pretty good, it's not perfect and it's not good enough for running tests in this package.
I'm going to close this issue now since the tests in question pass on Python 3.7 after @flu0r1ne's fix (thanks!)
Yes it is pytest, but no, it's not happening just with pytest. I merely used pytest to have a nicer control of running only the tests I wanted to show. Same failures happen without pytest.
OK, sounds like this might be a Python 3.12 issue. It's probably not related to the issue with the backport that we fixed. Please open a separate issue.
Please open a separate issue.
Will do.
Unclear if this is an actual issue or a test case artifact.