diff --git a/app/core/redis_client.py b/app/core/redis_client.py index 0e8175b..5b94908 100644 --- a/app/core/redis_client.py +++ b/app/core/redis_client.py @@ -1,6 +1,6 @@ import logging -import os import time +from contextlib import contextmanager from datetime import datetime from typing import Any, Protocol @@ -146,7 +146,7 @@ def client(self) -> Redis: return FakeRedis() def lock(self, name: str, blocking_timeout: float | int) -> Any: - return self.client.lock(name, blocking_timeout=blocking_timeout) + return fake_lock_context() def setnx(self, name: RedisKey, value: RedisValue) -> RedisResponse: if name not in self.db: @@ -165,4 +165,9 @@ def now(self) -> datetime: return dtaware_fromtimestamp(self.time()) +@contextmanager +def fake_lock_context(): + yield None + + redis = TestRedisClient() if get_settings().is_test else RedisClient() diff --git a/app/data/scripts/update_test_data/update_test_get_unicode_character_details.py b/app/data/scripts/update_test_data/update_test_get_unicode_character_details.py index 407cedf..02d1a4b 100644 --- a/app/data/scripts/update_test_data/update_test_get_unicode_character_details.py +++ b/app/data/scripts/update_test_data/update_test_get_unicode_character_details.py @@ -17,9 +17,9 @@ "∑", # U+2211 N-ARY SUMMATION (Math Symbol) "㑢", # U+3462 CJK UNIFIED IDEOGRAPH-3462 (CJK Ideograph) "穩", # U+7A69 CJK UNIFIED IDEOGRAPH-7A69 (CJK Ideograph w/ variants) - "范", # U+8303 CJK UNIFIED IDEOGRAPH-8303 (CJK Ideograph w/ multiple values for totalStrokes) - # "\uda92", # U+DA92 (High-Surrogate) - # "\udddd", # U+DDDD (Low Surrogate) + "范", # U+8303 CJK UNIFIED IDEOGRAPH-8303 (CJK Ideograph w/ multiple values for totalStrokes) # noqa: E501 + # "\uda92", # U+DA92 (High-Surrogate) # noqa: ERA001, E501 + # "\udddd", # U+DDDD (Low Surrogate) # noqa: ERA001, E501 "﨑", # U+FA11 CJK COMPATIBILITY IDEOGRAPH-FA11 (CJK Compatibility Ideograph) "\uf800", # U+F800 (Private Use) "\ufffe", # U+FFFE (Noncharacter) diff --git a/pyproject.toml b/pyproject.toml index 6d6f910..73e72ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,13 +38,15 @@ exclude = ''' [tool.ruff] line-length = 120 + +[tool.ruff.lint] select = ["B", "C4", "C90", "E", "ERA", "F", "FA", "I", "INT", "N", "PERF", "PGH", "PIE", "PLE", "PLW", "PTH", "RUF100", "SIM", "UP", "W", "YTT"] extend-select = ["I"] ignore = ["B019", "B905"] fixable = ["I"] unfixable = ["B", "C90", "PIE", "SIM"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "app/api/api_v1/dependencies.py" = ["E501"] "app/docs/dependencies/custom_parameters.py" = ["E501"] "app/docs/dependencies/filter_tables.py" = ["E501"]