From a4be4c1a69e01779c7b2054d80e1959de4018003 Mon Sep 17 00:00:00 2001 From: "mitchell.ludwig" Date: Sat, 14 Jun 2025 21:27:55 -0600 Subject: [PATCH] Using the same python executable to run inference tests, rather than system python --- tests/inference/extra_model_paths.yaml | 2 +- tests/inference/test_execution.py | 6 +++++- tests/inference/test_inference.py | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/inference/extra_model_paths.yaml b/tests/inference/extra_model_paths.yaml index 75b2e1ae4a68..68e056564d51 100644 --- a/tests/inference/extra_model_paths.yaml +++ b/tests/inference/extra_model_paths.yaml @@ -1,4 +1,4 @@ # Config for testing nodes testing: - custom_nodes: tests/inference/testing_nodes + custom_nodes: testing_nodes diff --git a/tests/inference/test_execution.py b/tests/inference/test_execution.py index 5cda5c1ae24a..62489b156f35 100644 --- a/tests/inference/test_execution.py +++ b/tests/inference/test_execution.py @@ -14,6 +14,10 @@ import urllib.parse import urllib.error from comfy_execution.graph_utils import GraphBuilder, Node +import os +import sys + +PYTHON_EXECUTABLE_PATH = os.path.realpath(sys.executable) class RunResult: def __init__(self, prompt_id: str): @@ -125,7 +129,7 @@ class TestExecution: def _server(self, args_pytest, request): # Start server pargs = [ - 'python','main.py', + PYTHON_EXECUTABLE_PATH,'main.py', '--output-directory', args_pytest["output_dir"], '--listen', args_pytest["listen"], '--port', str(args_pytest["port"]), diff --git a/tests/inference/test_inference.py b/tests/inference/test_inference.py index 7e4a206c41d9..bc7336f0453d 100644 --- a/tests/inference/test_inference.py +++ b/tests/inference/test_inference.py @@ -14,6 +14,8 @@ import uuid import urllib.request import urllib.parse +import sys + from comfy.samplers import KSampler @@ -21,6 +23,7 @@ """ These tests generate and save images through a range of parameters """ +PYTHON_EXECUTABLE_PATH = os.path.realpath(sys.executable) class ComfyGraph: def __init__(self, @@ -152,7 +155,7 @@ class TestInference: def _server(self, args_pytest): # Start server p = subprocess.Popen([ - 'python','main.py', + PYTHON_EXECUTABLE_PATH,'main.py', '--output-directory', args_pytest["output_dir"], '--listen', args_pytest["listen"], '--port', str(args_pytest["port"]),