]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🐛 Fix Windows UnicodeEncodeError in CLI test (#14295)
authorHemanth U <77799372+hemanth-thirthahalli@users.noreply.github.com>
Tue, 2 Dec 2025 04:02:38 +0000 (09:32 +0530)
committerGitHub <noreply@github.com>
Tue, 2 Dec 2025 04:02:38 +0000 (04:02 +0000)
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
tests/test_fastapi_cli.py

index a5c10778ad7e85f1eed28a46329f1df99e66103c..78a49a1fbe8ec9a9b31adfa9581e3dfff09bfa89 100644 (file)
@@ -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