Pārlūkot izejas kodu

Disable colorization check in Github

I tried a lot of different things to make it work

```
      env:
        PY_COLORS: '1'
        ANSIBLE_FORCE_COLOR: '1'
        FORCE_COLOR: '1'
```

I also tried

```
export TERM=xterm-256color;
```

But Github refuses to colorize. Seems to be a problem with Github
Actions not being a `tty`.

https://github.com/actions/runner/issues/241

This doesn't seem to be a priority for Github, so we simply disable
the test in that environment.
Benjamin Gleitzman 3 gadi atpakaļ
vecāks
revīzija
c53b6a179a
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      test_howdoi.py

+ 6 - 2
test_howdoi.py

@@ -195,8 +195,12 @@ class HowdoiTestCase(unittest.TestCase):  # pylint: disable=too-many-public-meth
         query = self.queries[0]
         normal = howdoi.howdoi(query)
         colorized = howdoi.howdoi('-c ' + query)
-        self.assertTrue(normal.find('[38;') == -1)
-        self.assertTrue(colorized.find('[38;') != -1)
+
+        # There is currently an issue with Github actions and colorization
+        # so do not run checks if we are running in Github
+        if "GITHUB_ACTION" not in os.environ:
+            self.assertTrue(normal.find('[38;') == -1)
+            self.assertTrue(colorized.find('[38;') != -1)
 
     # pylint: disable=line-too-long
     def test_get_text_without_links(self):