mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
feat(tests): Implemented basic tests and github workflow
This commit is contained in:
22
7project/backend/tests/conftest.py
Normal file
22
7project/backend/tests/conftest.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import sys
|
||||
import types
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
# Stub sentry_sdk to avoid optional dependency issues during import of app
|
||||
stub = types.ModuleType("sentry_sdk")
|
||||
stub.init = lambda *args, **kwargs: None
|
||||
sys.modules.setdefault("sentry_sdk", stub)
|
||||
|
||||
# Import the FastAPI application
|
||||
from app.app import fastApi as app # noqa: E402
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def fastapi_app():
|
||||
return app
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def client(fastapi_app):
|
||||
return TestClient(fastapi_app, raise_server_exceptions=True)
|
||||
Reference in New Issue
Block a user