Skip to content

Commit e9cc144

Browse files
committed
fix traceback color test GHA vs local misalignment
1 parent 3187fda commit e9cc144

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/test_tracebacks.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import re
2-
2+
import os
33
import pytest
44
from django.core.management import CommandError, call_command
55
from django.test import TestCase, override_settings
@@ -218,8 +218,14 @@ def test_colored_traceback(self):
218218
)[1]
219219
self.assertNotIn("\x1b", result)
220220

221-
result = run_command("test_command1", "delete", "Brian", "--throw")[1]
222-
self.assertNotIn("\x1b", result)
221+
result = run_command(
222+
"test_command1",
223+
"delete",
224+
"Brian",
225+
"--throw",
226+
env={"GITHUB_ACTIONS": "1", **os.environ},
227+
)[1]
228+
self.assertIn("\x1b", result)
223229

224230

225231
@pytest.mark.rich

0 commit comments

Comments
 (0)