From a1e7af4b34f87dda4843f369a784b0cb7bb679ca Mon Sep 17 00:00:00 2001 From: Christopher Rhodes <christopher.rhodes@embl.de> Date: Mon, 4 Mar 2024 16:42:22 +0100 Subject: [PATCH] Support subclassing of TestServerBaseClass with different FastAPI application route --- tests/test_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_api.py b/tests/test_api.py index 8489688a..2b67a67d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -7,6 +7,8 @@ from model_server.conf.testing import czifile class TestServerBaseClass(unittest.TestCase): + app_name = 'model_server.base.api:app' + def setUp(self) -> None: import uvicorn host = '127.0.0.1' @@ -14,7 +16,7 @@ class TestServerBaseClass(unittest.TestCase): self.server_process = Process( target=uvicorn.run, - args=('model_server.base.api:app', ), + args=(self.app_name, ), kwargs={'host': host, 'port': port, 'log_level': 'debug'}, daemon=True ) -- GitLab