From 9647741e07d58e5e4ccf7620fa4f6b3a30794299 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Sun, 26 Jul 2026 22:32:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=A4=8Druff=E5=85=A8?= =?UTF-8?q?=E9=87=8F=E6=A3=80=E6=9F=A5=E9=94=99=E8=AF=AF=20-=20test=5Fpres?= =?UTF-8?q?et=5Fbgm.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/test_preset_bgm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_preset_bgm.py b/tests/unit/test_preset_bgm.py index 2120fcf7d..932f4facc 100755 --- a/tests/unit/test_preset_bgm.py +++ b/tests/unit/test_preset_bgm.py @@ -1,6 +1,7 @@ """Preset BGM 预设背景音乐单元测试。""" import pytest +from dataclasses import FrozenInstanceError from packages.domain.preset_bgm import ( BGM_STYLES, @@ -42,7 +43,7 @@ class TestPresetBGMDataclass: def test_frozen_immutable(self): bgm = PresetBGM(id="t1", name="T", style="upbeat", duration=60.0) - with pytest.raises(Exception): # FrozenInstanceError + with pytest.raises(FrozenInstanceError): bgm.name = "new name" def test_equality(self): @@ -96,7 +97,7 @@ class TestBGMStyles: assert "cinematic" in BGM_STYLES def test_styles_have_chinese_names(self): - for key, value in BGM_STYLES.items(): + for _, value in BGM_STYLES.items(): assert isinstance(value, str) assert len(value) > 0