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:
0xbyt4 2026-02-26 21:48:56 +03:00
parent 7ceed9b6d9
commit 16ac6f0936
3 changed files with 6 additions and 3 deletions

View file

@ -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",