mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-19 12:57:58 +00:00
fix: use sys.executable instead of hardcoded "python" in tests
Tests that launch the API server via subprocess used a hardcoded "python" command which fails on systems where only "python3" is available (e.g. macOS). Using sys.executable ensures the same interpreter running pytest is used for subprocesses. Fixes 36 test errors on macOS environments.
This commit is contained in:
parent
b166c3a9d9
commit
4d8e9b8086
3 changed files with 6 additions and 3 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue