From a4c997de8aca6dde72f57a96519e569e00d2a3d9 Mon Sep 17 00:00:00 2001
From: Yoann Schneider <yschneider@teklia.com>
Date: Mon, 15 Apr 2024 20:04:19 +0200
Subject: [PATCH] Introduce UP024

---
 arkindex/project/tests/__init__.py | 2 +-
 ruff.toml                          | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arkindex/project/tests/__init__.py b/arkindex/project/tests/__init__.py
index 9db13cd987..ecceb69a5e 100644
--- a/arkindex/project/tests/__init__.py
+++ b/arkindex/project/tests/__init__.py
@@ -67,7 +67,7 @@ class _AssertExactQueriesContext(CaptureQueriesContext):
         if not self.path.exists():
             try:
                 self.path.write_text(actual_sql)
-            except IOError as e:
+            except OSError as e:
                 raise AssertionError(
                     f"Could not assert on SQL queries; the file at {self.path} did not exist. "
                     "A new file could not be created with the current SQL queries."
diff --git a/ruff.toml b/ruff.toml
index 3de53043e9..8b77a6a2a6 100644
--- a/ruff.toml
+++ b/ruff.toml
@@ -33,6 +33,8 @@ select = [
     "UP014",
     # redundant-open-modes
     "UP015",
+    # os-error-alias
+    "UP024",
 ]
 ignore = ["E501", "RET502", "RET503"]
 
-- 
GitLab