test_matrix: Run Python subprocess via sys.executable.
This works better with pytest on Windows.
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")
