diff --git a/tests/test_process_tests.py b/tests/test_process_tests.py index 59200d7..5e75b09 100644 --- a/tests/test_process_tests.py +++ b/tests/test_process_tests.py @@ -1,5 +1,6 @@ import os import re +import sys import socket import pytest @@ -13,7 +14,7 @@ def test_wait_for_strings(): - with TestProcess('python', '-c', 'print("foobar")') as proc: + with TestProcess(sys.executable, '-c', 'print("foobar")') as proc: wait_for_strings(proc.read, TIMEOUT, 'foobar') with pytest.raises(AssertionError): with dump_on_error(proc.read): @@ -22,7 +23,7 @@ def test_wait_for_strings(): def test_filebuffer(tmp_path): with tmp_path.joinpath('stdout').open('wb') as fh: - with TestProcess('python', '-c', 'print("foobar")', stdout=fh) as proc: + with TestProcess(sys.executable, '-c', 'print("foobar")', stdout=fh) as proc: wait_for_strings(proc.read, TIMEOUT, 'foobar') with pytest.raises(AssertionError): with dump_on_error(proc.read): @@ -30,7 +31,7 @@ def test_filebuffer(tmp_path): def test_socket(): - with TestProcess('python', '-mhttp.server', '0') as proc: + with TestProcess(sys.executable, '-mhttp.server', '0') as proc: with dump_on_error(proc.read, 'SERVER'): wait_for_strings(proc.read, TIMEOUT, 'Serving HTTP on') (port,) = re.match(r'Serving HTTP on .*? port (\d+) ', proc.read()).groups()