From 57e85692a5a972b03feab4a1304b0db749f20c6f Mon Sep 17 00:00:00 2001 From: 17TheWord <17theword@gmail.com> Date: Wed, 22 Oct 2025 17:54:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20patch=5Fadapter=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=AD=E7=9A=84=20monkeypatch=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E7=A1=AE=E4=BF=9D=E9=80=82=E9=85=8D=E5=99=A8?= =?UTF-8?q?=E7=9A=84=20=5Fcall=5Fapi=20=E6=96=B9=E6=B3=95=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E5=BC=95=E7=94=A8=E6=96=B0=E9=80=82=E9=85=8D=E5=99=A8?= =?UTF-8?q?=E7=9A=84=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebug/mixin/call_api/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nonebug/mixin/call_api/__init__.py b/nonebug/mixin/call_api/__init__.py index a4c18d8..6d88c99 100644 --- a/nonebug/mixin/call_api/__init__.py +++ b/nonebug/mixin/call_api/__init__.py @@ -106,7 +106,7 @@ def patch_adapter( self, monkeypatch: pytest.MonkeyPatch, adapter: "Adapter" ) -> None: new_adapter = self.create_adapter() - monkeypatch.setattr(adapter, "_call_api", getattr(new_adapter, "_call_api")) + monkeypatch.setattr(adapter.__class__, "_call_api", getattr(new_adapter.__class__, "_call_api")) def patch_bot(self, monkeypatch: pytest.MonkeyPatch, bot: "Bot") -> None: new_bot = self.create_bot(auto_connect=False) From 2f14192dce28bbbfc8ab2a848a677947c7cf335e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 09:55:38 +0000 Subject: [PATCH 2/2] :rotating_light: auto fix by pre-commit hooks --- nonebug/mixin/call_api/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nonebug/mixin/call_api/__init__.py b/nonebug/mixin/call_api/__init__.py index 6d88c99..77f504b 100644 --- a/nonebug/mixin/call_api/__init__.py +++ b/nonebug/mixin/call_api/__init__.py @@ -106,7 +106,9 @@ def patch_adapter( self, monkeypatch: pytest.MonkeyPatch, adapter: "Adapter" ) -> None: new_adapter = self.create_adapter() - monkeypatch.setattr(adapter.__class__, "_call_api", getattr(new_adapter.__class__, "_call_api")) + monkeypatch.setattr( + adapter.__class__, "_call_api", getattr(new_adapter.__class__, "_call_api") + ) def patch_bot(self, monkeypatch: pytest.MonkeyPatch, bot: "Bot") -> None: new_bot = self.create_bot(auto_connect=False)