kislyuk / argcomplete

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

3.2.2: pytest is failing #470

Closed kloczek closed 5 months ago

kloczek commented 5 months ago

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

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-argcomplete-3.2.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-argcomplete-3.2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' --deselect test/test_package/test_module.py ============================= test session starts ============================== platform linux -- Python 3.8.18, pytest-7.4.4, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/argcomplete-3.2.2 collected 60 items test/test_contrib_shells.py FFFFFFFFFFFFFFFFFFFFssssssssssssssssssssssss [ 73%] ssssssssssssssss [100%] =================================== FAILURES =================================== _____________________ TestShellBase.test_simple_completion _____________________ self = def test_simple_completion(self): > self.assertEqual(self.sh.run_command("prog basic f\t"), "foo\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1164: AttributeError ____________________ TestShellBase.test_partial_completion _____________________ self = def test_partial_completion(self): > self.assertEqual(self.sh.run_command("prog basic b\tr"), "bar\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1167: AttributeError _________________ TestShellBase.test_single_quoted_completion __________________ self = def test_single_quoted_completion(self): > self.assertEqual(self.sh.run_command("prog basic 'f\t"), "foo\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1170: AttributeError _________________ TestShellBase.test_double_quoted_completion __________________ self = def test_double_quoted_completion(self): > self.assertEqual(self.sh.run_command('prog basic "f\t'), "foo\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1173: AttributeError ______________________ TestShellBase.test_unquoted_space _______________________ self = def test_unquoted_space(self): > self.assertEqual(self.sh.run_command("prog space f\t"), "foo bar\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1176: AttributeError _______________________ TestShellBase.test_quoted_space ________________________ self = def test_quoted_space(self): > self.assertEqual(self.sh.run_command('prog space "f\t'), "foo bar\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1179: AttributeError _______________________ TestShellBase.test_continuation ________________________ self = def test_continuation(self): # This produces 'prog basic foo --', and '--' is ignored. > self.assertEqual(self.sh.run_command("prog basic f\t--"), "foo\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1183: AttributeError _______________________ TestShellBase.test_quoted_exact ________________________ self = def test_quoted_exact(self): > self.assertEqual(self.sh.run_command('prog basic "f\t--'), "foo\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1190: AttributeError ____________________ TestShellBase.test_special_characters _____________________ self = def test_special_characters(self): > self.assertEqual(self.sh.run_command("prog spec d\tf"), "d$e$f\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1193: AttributeError _____________ TestShellBase.test_special_characters_single_quoted ______________ self = def test_special_characters_single_quoted(self): > self.assertEqual(self.sh.run_command("prog spec 'd\tf'"), "d$e$f\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1198: AttributeError _____________ TestShellBase.test_special_characters_double_quoted ______________ self = def test_special_characters_double_quoted(self): > self.assertEqual(self.sh.run_command('prog spec "d\tf"'), "d$e$f\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1201: AttributeError _________________ TestShellBase.test_parse_special_characters __________________ self = def test_parse_special_characters(self): > self.assertEqual(self.sh.run_command("prog spec d$e$\tf"), "d$e$f\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1204: AttributeError ______________ TestShellBase.test_parse_special_characters_dollar ______________ self = def test_parse_special_characters_dollar(self): # First tab expands to 'd\$e\$'; completion works with 'd$' but not 'd\$'. > self.assertEqual(self.sh.run_command('prog spec "d$e\tf\t'), "d$e$f\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1210: AttributeError _______________ TestShellBase.test_exclamation_in_double_quotes ________________ self = def test_exclamation_in_double_quotes(self): # Exclamation marks cannot be properly escaped within double quotes. # 'a!b' == "a"\!"b" > self.assertEqual(self.sh.run_command('prog spec "x\t'), "x!x\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1215: AttributeError __________________________ TestShellBase.test_quotes ___________________________ self = def test_quotes(self): > self.assertEqual(self.sh.run_command("prog quote 1\t"), "1'1\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1218: AttributeError ______________ TestShellBase.test_single_quotes_in_double_quotes _______________ self = def test_single_quotes_in_double_quotes(self): > self.assertEqual(self.sh.run_command('prog quote "1\t'), "1'1\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1222: AttributeError ______________ TestShellBase.test_single_quotes_in_single_quotes _______________ self = def test_single_quotes_in_single_quotes(self): # Single quotes cannot be escaped within single quotes. # "a'b" == 'a'\''b' > self.assertEqual(self.sh.run_command("prog quote '1\t"), "1'1\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1227: AttributeError ______________________ TestShellBase.test_wordbreak_chars ______________________ self = def test_wordbreak_chars(self): > self.assertEqual(self.sh.run_command("prog break a\tc"), "a:b:c\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1230: AttributeError __________________ TestShellBase.test_completion_environment ___________________ self = def test_completion_environment(self): > self.assertEqual(self.sh.run_command("prog env o\t"), "ok\r\n") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1239: AttributeError ________________________ TestShellBase.test_comp_point _________________________ self = def test_comp_point(self): # Use environment variable to change how prog behaves > self.assertEqual(self.sh.run_command("export POINT=1"), "") E AttributeError: 'TestShellBase' object has no attribute 'assertEqual' test/test.py:1243: AttributeError =========================== short test summary info ============================ SKIPPED [1] test/test.py:1241: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1238: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1181: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1172: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1212: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1203: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1208: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1166: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1189: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1178: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1217: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1163: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1169: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1221: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1224: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1192: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1200: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1197: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1175: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1229: tcsh is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1241: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1238: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1181: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1172: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1212: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1203: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1208: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1166: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1189: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1178: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1217: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1163: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1169: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1221: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1224: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1192: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1200: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1197: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1175: fish is not supported. Enable this test manually if needed. SKIPPED [1] test/test.py:1229: fish is not supported. Enable this test manually if needed. FAILED test/test_contrib_shells.py::TestShellBase::test_simple_completion - A... FAILED test/test_contrib_shells.py::TestShellBase::test_partial_completion - ... FAILED test/test_contrib_shells.py::TestShellBase::test_single_quoted_completion FAILED test/test_contrib_shells.py::TestShellBase::test_double_quoted_completion FAILED test/test_contrib_shells.py::TestShellBase::test_unquoted_space - Attr... FAILED test/test_contrib_shells.py::TestShellBase::test_quoted_space - Attrib... FAILED test/test_contrib_shells.py::TestShellBase::test_continuation - Attrib... FAILED test/test_contrib_shells.py::TestShellBase::test_quoted_exact - Attrib... FAILED test/test_contrib_shells.py::TestShellBase::test_special_characters - ... FAILED test/test_contrib_shells.py::TestShellBase::test_special_characters_single_quoted FAILED test/test_contrib_shells.py::TestShellBase::test_special_characters_double_quoted FAILED test/test_contrib_shells.py::TestShellBase::test_parse_special_characters FAILED test/test_contrib_shells.py::TestShellBase::test_parse_special_characters_dollar FAILED test/test_contrib_shells.py::TestShellBase::test_exclamation_in_double_quotes FAILED test/test_contrib_shells.py::TestShellBase::test_quotes - AttributeErr... FAILED test/test_contrib_shells.py::TestShellBase::test_single_quotes_in_double_quotes FAILED test/test_contrib_shells.py::TestShellBase::test_single_quotes_in_single_quotes FAILED test/test_contrib_shells.py::TestShellBase::test_wordbreak_chars - Att... FAILED test/test_contrib_shells.py::TestShellBase::test_completion_environment FAILED test/test_contrib_shells.py::TestShellBase::test_comp_point - Attribut... ======================== 20 failed, 40 skipped in 0.77s ======================== ```
List of installed modules in build env: ```console Package Version ----------------------------- ------- alabaster 0.7.16 Babel 2.14.0 build 1.0.3 charset-normalizer 3.3.2 contourpy 1.0.7 cppclean 0.13 cycler 0.12.1 distro 1.9.0 dnf 4.18.2 docutils 0.20.1 exceptiongroup 1.1.3 fonttools 4.47.2 gpg 1.23.2 guzzle-sphinx-theme 0.7.11 idna 3.6 imagesize 1.4.1 importlib-metadata 7.0.1 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.3 kiwisolver 1.4.5 libdnf 0.72.0 MarkupSafe 2.1.3 matplotlib 3.6.3 numpy 1.24.4 olefile 0.47 packaging 23.2 pexpect 4.9.0 pillow 10.2.0 pluggy 1.3.0 ptyprocess 0.7.0 Pygments 2.17.2 pyparsing 3.1.1 pyproject_hooks 1.0.0 pytest 7.4.4 python-dateutil 2.8.2 pytz 2023.3 requests 2.31.0 setuptools 69.0.3 setuptools-scm 8.0.4 six 1.16.0 snowballstemmer 2.2.0 Sphinx 7.1.2 sphinx-copybutton 0.5.2 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.5 sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.7 sphinxcontrib-serializinghtml 1.1.10 sphinxext-opengraph 0.8.2 tomli 2.0.1 typing_extensions 4.9.0 urllib3 1.26.18 wheel 0.42.0 zipp 3.17.0 ```

Please let me know if you need more details or want me to perform some diagnostics.

kislyuk commented 5 months ago

argcomplete does not support testing with pytest.