Skip to content

Commit d2bf13e

Browse files
Set UTF-8 output
1 parent eef431b commit d2bf13e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/python/run_tests.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@
33
# PowerShell script to run pytest with coverage.
44
# This script can be run from any working directory.
55

6+
Set-StrictMode -Version Latest
67
$ErrorActionPreference = "Stop"
78

9+
# Set UTF-8 encoding for console output to properly display Unicode characters
10+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
11+
812
$ScriptDir = $PSScriptRoot
913
$RepoRoot = (Resolve-Path (Join-Path $ScriptDir "..\.."))
1014

15+
# Set Python to use UTF-8 and unbuffered output
16+
$env:PYTHONIOENCODING = "utf-8"
17+
$env:PYTHONUNBUFFERED = "1"
18+
1119
Push-Location $RepoRoot
1220
try {
1321
$env:COVERAGE_FILE = (Join-Path $RepoRoot "tests/python/.coverage")
14-
pytest -v --cov=shared/python --cov-config=tests/python/.coveragerc --cov-report=html:tests/python/htmlcov tests/python/
22+
pytest -v --color=yes --cov=shared/python --cov-config=tests/python/.coveragerc --cov-report=html:tests/python/htmlcov tests/python/
1523
}
1624
finally {
1725
Pop-Location

0 commit comments

Comments
 (0)