diff --git a/atroposlib/tests/api_test_utils.py b/atroposlib/tests/api_test_utils.py index c88d51f2..200ada8c 100644 --- a/atroposlib/tests/api_test_utils.py +++ b/atroposlib/tests/api_test_utils.py @@ -1,4 +1,5 @@ import subprocess +import sys import time import requests @@ -16,7 +17,7 @@ def launch_api_for_testing(max_wait_for_api: int = 10) -> subprocess.Popen: # Use subprocess instead of multiprocessing to avoid inheriting pytest args api_proc = subprocess.Popen( [ - "python", + sys.executable, "-m", "atroposlib.cli.run_api", "--host", diff --git a/atroposlib/tests/test_api_compression.py b/atroposlib/tests/test_api_compression.py index 25cbdfe0..0202c3ad 100644 --- a/atroposlib/tests/test_api_compression.py +++ b/atroposlib/tests/test_api_compression.py @@ -5,6 +5,7 @@ import json import os import signal import subprocess +import sys import time import pytest @@ -27,7 +28,7 @@ def wait_for_api_server(max_wait=10): def api_server(): proc = subprocess.Popen( [ - "python", + sys.executable, "-m", "atroposlib.cli.run_api", "--host", diff --git a/atroposlib/tests/test_api_messages_handling.py b/atroposlib/tests/test_api_messages_handling.py index 0f7ac922..228be3ea 100644 --- a/atroposlib/tests/test_api_messages_handling.py +++ b/atroposlib/tests/test_api_messages_handling.py @@ -5,6 +5,7 @@ Tests for API server message handling, particularly for SFT (Supervised Fine-Tun import os import signal import subprocess +import sys import time import pytest @@ -30,7 +31,7 @@ def api_server(): # Start the API server as a subprocess proc = subprocess.Popen( [ - "python", + sys.executable, "-m", "atroposlib.cli.run_api", "--host",