[pre-commit.ci] pre-commit autoupdate (#278)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index f69e7bc..0e8763f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -16,7 +16,7 @@
         additional_dependencies: [ "tomli>=2.0.1" ]
         args: [ "--in-place", "--config", "./pyproject.toml" ]
   - repo: https://github.com/astral-sh/ruff-pre-commit
-    rev: "v0.4.1"
+    rev: "v0.4.2"
     hooks:
       - id: ruff-format
       - id: ruff
diff --git a/tests/test_api.py b/tests/test_api.py
index cb28028..a868e29 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -93,7 +93,8 @@
 
 def _fake_import(name: str, *args: Any, **kwargs: Any) -> ModuleType:  # noqa: ANN401
     if name == "ctypes":
-        raise ModuleNotFoundError("No module named %s" % name)
+        msg = f"No module named {name}"
+        raise ModuleNotFoundError(msg)
     return builtin_import(name, *args, **kwargs)