End of phase 4
authorSam Mirazi <sasan345@gmail.com>
Sun, 1 Jun 2025 06:53:33 +0000 (23:53 -0700)
committerSam Mirazi <sasan345@gmail.com>
Sun, 1 Jun 2025 06:53:33 +0000 (23:53 -0700)
tests/__pycache__/test_fastapi_route.cpython-312-pytest-8.3.5.pyc
tests/__pycache__/test_fastapi_route.cpython-312.pyc
tests/__pycache__/test_flask_route.cpython-312-pytest-8.3.5.pyc
tests/test_fastapi_route.py

index d59111794cb699e712765566e5dc7cc95fb75cf1..7c2c6fff0fcc7eae6043d906bf0ca715d896128a 100644 (file)
Binary files a/tests/__pycache__/test_fastapi_route.cpython-312-pytest-8.3.5.pyc and b/tests/__pycache__/test_fastapi_route.cpython-312-pytest-8.3.5.pyc differ
index 0dc75b355a66bdf02c2472b80e40de563ea33617..f484d075d32a8e74dae8e6f121074e3b04324444 100644 (file)
Binary files a/tests/__pycache__/test_fastapi_route.cpython-312.pyc and b/tests/__pycache__/test_fastapi_route.cpython-312.pyc differ
index 5dbc3548e370d4b9fb6700a9f94623571556da27..47271f62d41c25398f2a3d286cfdea42b2f1a613 100644 (file)
Binary files a/tests/__pycache__/test_flask_route.cpython-312-pytest-8.3.5.pyc and b/tests/__pycache__/test_flask_route.cpython-312-pytest-8.3.5.pyc differ
index 40ff1d2d61efd65f5972f3c36c7d026a160ae2db..f6e646a82188ef467037ec11fe6379625fd1ef01 100644 (file)
@@ -6,6 +6,7 @@ import uvicorn
 import threading
 import time
 from multiprocessing import Process # Using Process for better isolation
+import os
 
 # Server configuration
 HOST = "127.0.0.1"
@@ -30,12 +31,16 @@ class UvicornServer(threading.Thread):
     # UvicornServer using Process for cleaner start/stop
     # This might be more robust for test isolation.
 
-def run_server_process(app_module_str, host, port):
+def run_server_process(app_module_str, host, port, project_root_dir):
+    # Add project root to Python path for the new process
+    import sys
+    sys.path.insert(0, project_root_dir)
     uvicorn.run(app_module_str, host=host, port=port, log_level="warning")
 
 async def start_server_fastapi():
+    project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
     # Using Process to run Uvicorn. This provides better isolation and cleanup.
-    proc = Process(target=run_server_process, args=("app_fastapi.app:app", HOST, PORT), daemon=True)
+    proc = Process(target=run_server_process, args=("app_fastapi.app:app", HOST, PORT, project_root), daemon=True)
     proc.start()
     await asyncio.sleep(2.0) # Increased sleep to ensure server is fully up
     if not proc.is_alive():