From cdf8d32ac0c74d1a566ae82fae8d27d952988e01 Mon Sep 17 00:00:00 2001 From: Game_Time <108236317+RayBytes@users.noreply.github.com> Date: Sun, 20 Aug 2023 15:46:20 +0500 Subject: [PATCH] hopefully final please work --- run/__main__.py | 10 +--------- tests/__main__.py | 4 ++++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/run/__main__.py b/run/__main__.py index 88426b7..f188ef0 100644 --- a/run/__main__.py +++ b/run/__main__.py @@ -23,12 +23,4 @@ if 'prod' in sys.argv: port = 2333 dev = False -os.system(f'cd api && uvicorn main:app{" --reload" if dev else ""} --host 0.0.0.0 --port {port}') - -time.sleep(2) - -import tests.__main__ as tests -tests.test_all() - - - +os.system(f'cd api && uvicorn main:app{" --reload" if dev else ""} --host 0.0.0.0 --port {port} & python tests') diff --git a/tests/__main__.py b/tests/__main__.py index afd91cc..7348355 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -3,6 +3,7 @@ import os import openai as closedai import httpx +import time from rich import print from typing import List @@ -92,6 +93,9 @@ def test_api_moderation() -> dict: def test_all(): """Runs all tests.""" + print("Waiting until API Server is started up...") + time.sleep(5) + print('[lightblue]Running test on API server to check if its running...') print(test_server())