add pytest

This commit is contained in:
bridge
2025-12-14 15:13:48 +08:00
parent 6b0bf25699
commit 30a10bbb1c
4 changed files with 174 additions and 64 deletions

View File

@@ -304,8 +304,10 @@ class Avatar(
self._init_known_regions()
def __hash__(self) -> int:
if not hasattr(self, 'id'):
# 防御性编程如果id尚未初始化例如deepcopy过程中使用对象内存地址
return super().__hash__()
return hash(self.id)
def __str__(self) -> str:
return str(self.get_info(detailed=False))