kislyuk/argcomplete

zsh-related tests fail when TERM variable is set to linux

Closed this issue · 1 comments

Hello,
Running the test-suite with TERM=linux causes issues with the zsh-related tests (see below). The TERM variable is set in the Ubuntu CI infrastructure, causing red tests for python-argcomplete.

excerpt:

======================================================================
FAIL: test_special_characters (test.test.TestZshGlobalImplicit.test_special_characters)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/olivier/dev/canonical/argcomplete/test/test.py", line 1261, in setUp
    self.assertEqual(output, "ready\r\n")
AssertionError: 'ready\r\n\x1b[m\x0f\x1b[27m\x1b[24m\x1b[J' != 'ready\r\n'
  ready
- 
+ 


======================================================================
FAIL: test_special_characters_double_quoted (test.test.TestZshGlobalImplicit.test_special_characters_double_quoted)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/olivier/dev/canonical/argcomplete/test/test.py", line 1261, in setUp
    self.assertEqual(output, "ready\r\n")
AssertionError: 'ready\r\n\x1b[m\x0f\x1b[27m\x1b[24m\x1b[J' != 'ready\r\n'
  ready
- 
+ 


======================================================================
FAIL: test_special_characters_single_quoted (test.test.TestZshGlobalImplicit.test_special_characters_single_quoted)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/olivier/dev/canonical/argcomplete/test/test.py", line 1261, in setUp
    self.assertEqual(output, "ready\r\n")
AssertionError: 'ready\r\n\x1b[m\x0f\x1b[27m\x1b[24m\x1b[J' != 'ready\r\n'
  ready
- 
+ 


======================================================================
FAIL: test_unquoted_space (test.test.TestZshGlobalImplicit.test_unquoted_space)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/olivier/dev/canonical/argcomplete/test/test.py", line 1261, in setUp
    self.assertEqual(output, "ready\r\n")
AssertionError: 'ready\r\n\x1b[m\x0f\x1b[27m\x1b[24m\x1b[J' != 'ready\r\n'
  ready
- 
+ 


======================================================================
FAIL: test_wordbreak_chars (test.test.TestZshGlobalImplicit.test_wordbreak_chars)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/olivier/dev/canonical/argcomplete/test/test.py", line 1261, in setUp
    self.assertEqual(output, "ready\r\n")
AssertionError: 'ready\r\n\x1b[m\x0f\x1b[27m\x1b[24m\x1b[J' != 'ready\r\n'
  ready
- 
+ 

Link to full report https://autopkgtest.ubuntu.com/results/autopkgtest-oracular/oracular/amd64/p/python-argcomplete/20240801_161300_87da0@/log.gz

Since we are already setting setting the PS1 variable in the test-suite, I suggest we also set the TERM variable.

I will open a PR.

Thanks,
Olivier

Fixed in #497