kislyuk / argcomplete

Python and tab completion, better together.
https://kislyuk.github.io/argcomplete/
Apache License 2.0
1.39k stars 129 forks source link

1.12.3: test suite is failing #354

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

Fists it would be god to migrate to pytest (https://github.com/pytest-dev/unittest2pytest/ may help). Nevertheless included test.py fails.

I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.

====================================================================== FAIL: test_completion_environment (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_continuation (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_debug_output (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_double_quoted_completion (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_exclamation_in_double_quotes (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_nounset (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_one_space_after_exact (main.TestBash) Test exactly one space is appended after an exact match.

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_parse_special_characters (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_parse_special_characters_dollar (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_partial_completion (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_quoted_exact (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_quoted_space (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_quotes (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_simple_completion (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_single_quoted_completion (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_single_quotes_in_double_quotes (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_single_quotes_in_single_quotes (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_special_characters (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_special_characters_double_quoted (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_special_characters_single_quoted (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_temp_file (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_unquoted_space (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_wordbreak_chars (main.TestBash)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_comp_point (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_completion_environment (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_console_script_module (main.TestBashGlobal) Test completing a console_script for a module.

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_console_script_module_wheel (main.TestBashGlobal) Test completing a console_script for a module from a wheel.

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_console_script_package (main.TestBashGlobal) Test completing a console_script for a package.

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_console_script_package_wheel (main.TestBashGlobal) Test completing a console_script for a package from a wheel.

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_continuation (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_debug_output (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_double_quoted_completion (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_exclamation_in_double_quotes (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_nounset (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_one_space_after_exact (main.TestBashGlobal) Test exactly one space is appended after an exact match.

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_parse_special_characters (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_parse_special_characters_dollar (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_partial_completion (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_python_completion (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_python_filename_completion (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_python_module (main.TestBashGlobal) Test completing a module run with python3 -m.

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_python_not_executable (main.TestBashGlobal) Test completing a script that cannot be run directly.

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_quoted_exact (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_quoted_space (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_quotes (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_simple_completion (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_single_quoted_completion (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_single_quotes_in_double_quotes (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_single_quotes_in_single_quotes (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_special_characters (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_special_characters_double_quoted (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_special_characters_single_quoted (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_temp_file (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_unquoted_space (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''

====================================================================== FAIL: test_wordbreak_chars (main.TestBashGlobal)

Traceback (most recent call last): File "./test/test.py", line 1215, in setUp self.assertEqual(output, '') AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''


Ran 147 tests in 105.281s

FAILED (failures=56, skipped=2, expected failures=9)

kislyuk commented 2 years ago

Thanks for your input. There is no plan to migrate this project to pytest, as it adds complexity that is not warranted for a test suite that is as simple as this one.

The issue that you encountered is due to a bug in a test dependency, pexpect (see https://github.com/kislyuk/argcomplete/issues/337). You can track the status of the upstream bug using the link in that issue.

kislyuk commented 2 years ago

To add the necessary detail here for your convenience: the workaround for the pexpect bug is to disable "bracketed paste mode" in your terminal using printf '\e[?2004l' or any other method.