From 35c53767bb14f8bcf35179b21b7012a3d1a70b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 14 Dec 2022 20:00:43 +0100 Subject: [PATCH] Fixup tests on Windows, use UTF-8 for subprocess --- tests/unit/session/test_parallel.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/session/test_parallel.py b/tests/unit/session/test_parallel.py index e08ef1f0c1..3508cfe5f7 100644 --- a/tests/unit/session/test_parallel.py +++ b/tests/unit/session/test_parallel.py @@ -270,9 +270,11 @@ def test_parallel_result_json_concurrent(cmd, parallel_project, tmp_path): def invoke_tox_in_thread(thread_name, result_json): try: # needs to be process to have it's own stdout + kwargs = {"encoding": "utf-8"} if sys.version_info >= (3, 6) else {} invoke_result[thread_name] = subprocess.check_output( [sys.executable, "-m", "tox", "-p", "all", "--result-json", str(result_json)], universal_newlines=True, + **kwargs ) except subprocess.CalledProcessError as exception: invoke_result[thread_name] = exception