From b426b8cc21420ffc6edcaf523832afe30096bd4a Mon Sep 17 00:00:00 2001 From: Benjamin Gleitzman Date: Sat, 19 Feb 2022 13:05:37 -0800 Subject: [PATCH] Enable colorization using the `script` command. More info at https://github.com/actions/runner/issues/241#issuecomment-577360161 --- .github/workflows/python-non-master.yml | 2 +- .github/workflows/python.yml | 2 +- test_howdoi.py | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-non-master.yml b/.github/workflows/python-non-master.yml index 40663bdb4..4757c3105 100644 --- a/.github/workflows/python-non-master.yml +++ b/.github/workflows/python-non-master.yml @@ -36,4 +36,4 @@ jobs: pylint howdoi *.py --rcfile=.pylintrc - name: Test with nose run: | - nose2 + script -e -c nose2 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 984b64ad9..7585a9a84 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -32,4 +32,4 @@ jobs: pylint howdoi *.py --rcfile=.pylintrc - name: Test with nose run: | - nose2 + script -e -c nose2 diff --git a/test_howdoi.py b/test_howdoi.py index 35aac5254..4524a994a 100644 --- a/test_howdoi.py +++ b/test_howdoi.py @@ -196,11 +196,8 @@ def test_colorize(self): normal = howdoi.howdoi(query) colorized = howdoi.howdoi('-c ' + query) - # 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) + self.assertTrue(normal.find('[38;') == -1) + self.assertTrue(colorized.find('[38;') != -1) # pylint: disable=line-too-long def test_get_text_without_links(self):