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