Skip to content

Commit e8b84c7

Browse files
committed
fix windows tests
1 parent e9fbd65 commit e8b84c7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ sphinx = true
109109
[tool.pytest.ini_options]
110110
# py.test options:
111111
DJANGO_SETTINGS_MODULE = "tests.settings"
112+
PYTHONIOENCODING = "utf-8"
112113
python_files = "test_*.py"
113114
norecursedirs = "*.egg .eggs dist build docs .tox .git __pycache__ shellcompletion"
114115
env = [

tests/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def test_helps_rich(self):
605605
"routine",
606606
"--help",
607607
],
608-
env=os.environ.copy(),
608+
env={**os.environ.copy(), "PYTHONIOENCODING": "utf-8"},
609609
capture_output=True,
610610
)
611611
self.assertEqual(
@@ -614,7 +614,7 @@ def test_helps_rich(self):
614614
self.assertFalse(result.stderr)
615615
hlp_txt = self.strip_ansi(result.stdout.decode()).strip()
616616
expected = self.routine_help_rich.strip()
617-
self.assertEqual(hlp_txt, expected)
617+
self.assertGreater(similarity(hlp_txt, expected), 0.99)
618618

619619
stdout = StringIO()
620620

0 commit comments

Comments
 (0)