From cb00a2931115c499f3cc8c590a26817098d065f6 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 24 Aug 2021 16:50:57 -0700 Subject: [PATCH] test_matrix: Run Python subprocess via sys.executable. This works better with pytest on Windows. Signed-off-by: Anders Kaseorg --- zulip/integrations/bridge_with_matrix/test_matrix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zulip/integrations/bridge_with_matrix/test_matrix.py b/zulip/integrations/bridge_with_matrix/test_matrix.py index 3fe0b94..d651f22 100644 --- a/zulip/integrations/bridge_with_matrix/test_matrix.py +++ b/zulip/integrations/bridge_with_matrix/test_matrix.py @@ -1,5 +1,6 @@ import os import shutil +import sys from contextlib import contextmanager from subprocess import PIPE, Popen from tempfile import mkdtemp @@ -41,7 +42,7 @@ def new_temp_dir() -> Iterator[str]: class MatrixBridgeScriptTests(TestCase): def output_from_script(self, options: List[str]) -> List[str]: popen = Popen( - ["python", script] + options, stdin=PIPE, stdout=PIPE, universal_newlines=True + [sys.executable, script] + options, stdin=PIPE, stdout=PIPE, universal_newlines=True ) return popen.communicate()[0].strip().split("\n")