Skip to content

Commit

Permalink
Add conftest.py for unit tests and update test_service.py
Browse files Browse the repository at this point in the history
  • Loading branch information
donnybeelo committed Aug 19, 2024
1 parent be2f687 commit 4e9c5a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Copyright (c) 2023 Genome Research Ltd.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""


import pytest
from fastapi.testclient import TestClient

from softpack_core.app import app


@pytest.fixture
def client() -> TestClient:
return TestClient(app.router)
2 changes: 1 addition & 1 deletion tests/unit/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_service_run() -> None:
run = multiprocessing.Process(target=ServiceAPI.run, kwargs={"serviceReady": ready})
run.start()
ready.wait(timeout=120)
response = httpx.get(app.url())
sleep(10)
run.terminate()
status = Box(response.json())
assert status.softpack.core.version == __version__

0 comments on commit 4e9c5a5

Please sign in to comment.