From 0c1a2514af7b05067e756dcd626225869247fc05 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Fri, 10 Jan 2025 09:44:25 +0800 Subject: [PATCH] fix: ruff with statements Signed-off-by: yihong0618 --- api/.ruff.toml | 1 - .../integration_tests/controllers/test_controllers.py | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/api/.ruff.toml b/api/.ruff.toml index 89a2da35d6cf87..fb20be315cffad 100644 --- a/api/.ruff.toml +++ b/api/.ruff.toml @@ -68,7 +68,6 @@ ignore = [ "SIM107", # return-in-try-except-finally "SIM108", # if-else-block-instead-of-if-exp "SIM113", # enumerate-for-loop - "SIM117", # multiple-with-statements "SIM210", # if-expr-with-true-false ] diff --git a/api/tests/integration_tests/controllers/test_controllers.py b/api/tests/integration_tests/controllers/test_controllers.py index 5e3ee6bedc7ebb..276ad3a7ed818a 100644 --- a/api/tests/integration_tests/controllers/test_controllers.py +++ b/api/tests/integration_tests/controllers/test_controllers.py @@ -4,7 +4,6 @@ def test_post_requires_login(app): - with app.test_client() as client: - with patch("flask_login.utils._get_user", mock_user): - response = client.get("/console/api/data-source/integrates") - assert response.status_code == 200 + with app.test_client() as client, patch("flask_login.utils._get_user", mock_user): + response = client.get("/console/api/data-source/integrates") + assert response.status_code == 200