Skip to content

Commit

Permalink
refactor: improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
rivamarco committed Dec 17, 2024
1 parent 2b17c60 commit b53bdeb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def lifespan(fastapi: FastAPI):
logger.info('Stopping service ...')


app = FastAPI(title='Radicalbit Platform', lifespan=lifespan, debug=False)
app = FastAPI(title='Radicalbit Platform', lifespan=lifespan)

app.add_middleware(
CORSMiddleware,
Expand Down
2 changes: 1 addition & 1 deletion api/tests/routes/healthcheck_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from app import main

client = TestClient(main.app)
client = TestClient(main.app, raise_server_exceptions=False)


def test_healthcheck():
Expand Down
2 changes: 1 addition & 1 deletion api/tests/routes/metrics_route_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setUpClass(cls):
app.add_exception_handler(MetricsError, metrics_exception_handler)
app.include_router(router, prefix=cls.prefix)

cls.client = TestClient(app)
cls.client = TestClient(app, raise_server_exceptions=False)

def test_get_reference_statistics_by_model_by_uuid(self):
model_uuid = uuid.uuid4()
Expand Down
2 changes: 1 addition & 1 deletion api/tests/routes/model_route_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setUpClass(cls):
app.add_exception_handler(ModelError, model_exception_handler)
app.include_router(router, prefix=cls.prefix)

cls.client = TestClient(app)
cls.client = TestClient(app, raise_server_exceptions=False)

def test_create_model(self):
model_in = db_mock.get_sample_model_in()
Expand Down
2 changes: 1 addition & 1 deletion api/tests/routes/modelin_validation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestValidationModelRoute(unittest.TestCase):
def setUp(self):
self.model_service = MagicMock(spec_set=ModelService)
self.prefix = '/api/models'
self.client = TestClient(main.app)
self.client = TestClient(main.app, raise_server_exceptions=False)

def test_request_validation_exception_handler(self):
modelin_data = get_model_sample_wrong(
Expand Down
2 changes: 1 addition & 1 deletion api/tests/routes/upload_dataset_route_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def setUpClass(cls):
app = FastAPI(title='Radicalbit Platform', debug=True)
app.include_router(router, prefix=cls.prefix)

cls.client = TestClient(app)
cls.client = TestClient(app, raise_server_exceptions=False)

def test_upload_reference(self):
file = csv.get_correct_sample_csv_file()
Expand Down

0 comments on commit b53bdeb

Please sign in to comment.