From: Hemanth U <77799372+hemanth-thirthahalli@users.noreply.github.com> Date: Tue, 2 Dec 2025 04:02:38 +0000 (+0530) Subject: 🐛 Fix Windows UnicodeEncodeError in CLI test (#14295) X-Git-Tag: 0.123.1~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf322d0e94abf67fc407abb26c9718c3ac73d2d4;p=thirdparty%2Ffastapi%2Ffastapi.git 🐛 Fix Windows UnicodeEncodeError in CLI test (#14295) Co-authored-by: Sofie Van Landeghem Co-authored-by: Sebastián Ramírez --- diff --git a/tests/test_fastapi_cli.py b/tests/test_fastapi_cli.py index a5c10778ad..78a49a1fbe 100644 --- a/tests/test_fastapi_cli.py +++ b/tests/test_fastapi_cli.py @@ -1,3 +1,4 @@ +import os import subprocess import sys from unittest.mock import patch @@ -20,6 +21,7 @@ def test_fastapi_cli(): ], capture_output=True, encoding="utf-8", + env={**os.environ, "PYTHONIOENCODING": "utf-8"}, ) assert result.returncode == 1, result.stdout assert "Path does not exist non_existent_file.py" in result.stdout