From 9af78ca1fa97caae431b5808aaa59637e6ed0d92 Mon Sep 17 00:00:00 2001 From: suluyan Date: Wed, 22 Jul 2026 16:50:21 +0800 Subject: [PATCH] style: yapf format legacy cache reuse helpers Co-authored-by: Cursor --- modelscope/hub/utils/utils.py | 4 ++-- tests/hub/test_legacy_cache_reuse.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modelscope/hub/utils/utils.py b/modelscope/hub/utils/utils.py index 7a8c43c4..7b7c042e 100644 --- a/modelscope/hub/utils/utils.py +++ b/modelscope/hub/utils/utils.py @@ -251,8 +251,8 @@ def find_reusable_legacy_repo_dir( ] for path in legacy_candidates: if _non_empty_dir(path): - logger.info( - 'Found legacy cache at %s for %s, reusing.', path, repo_id) + logger.info('Found legacy cache at %s for %s, reusing.', path, + repo_id) return str(path) return None diff --git a/tests/hub/test_legacy_cache_reuse.py b/tests/hub/test_legacy_cache_reuse.py index eb02e4f8..fc68276a 100644 --- a/tests/hub/test_legacy_cache_reuse.py +++ b/tests/hub/test_legacy_cache_reuse.py @@ -75,7 +75,8 @@ class LegacyCacheReuseTest(unittest.TestCase): def test_uses_modelscope_cache_env(self): legacy = self.cache / self.owner / self.name self._touch_model_dir(legacy) - with mock.patch.dict(os.environ, {'MODELSCOPE_CACHE': str(self.cache)}): + with mock.patch.dict(os.environ, + {'MODELSCOPE_CACHE': str(self.cache)}): found = find_reusable_legacy_repo_dir(self.model_id) self.assertEqual(found, str(legacy))