🐛 Fix Windows UnicodeEncodeError in CLI test (#14295)

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Hemanth U 2025-12-02 09:32:38 +05:30 committed by GitHub
parent 327bad18aa
commit bf322d0e94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View 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