mirror of https://github.com/tiangolo/fastapi.git
🐛 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:
parent
327bad18aa
commit
bf322d0e94
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
@ -20,6 +21,7 @@ def test_fastapi_cli():
|
||||||
],
|
],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
|
env={**os.environ, "PYTHONIOENCODING": "utf-8"},
|
||||||
)
|
)
|
||||||
assert result.returncode == 1, result.stdout
|
assert result.returncode == 1, result.stdout
|
||||||
assert "Path does not exist non_existent_file.py" in result.stdout
|
assert "Path does not exist non_existent_file.py" in result.stdout
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue