From 294b035fb47853969d101272a854a4f79bf5c3ea Mon Sep 17 00:00:00 2001 From: better629 Date: Wed, 10 Jan 2024 19:27:33 +0800 Subject: [PATCH] fix format --- metagpt/actions/action_outcls_registry.py | 2 +- tests/metagpt/actions/test_action_outcls_registry.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/metagpt/actions/action_outcls_registry.py b/metagpt/actions/action_outcls_registry.py index 780a061b4..6baa4cea9 100644 --- a/metagpt/actions/action_outcls_registry.py +++ b/metagpt/actions/action_outcls_registry.py @@ -5,7 +5,6 @@ from functools import wraps - action_outcls_registry = dict() @@ -14,6 +13,7 @@ def register_action_outcls(func): Due to `create_model` return different Class even they have same class name and mapping. In order to do a comparison, use outcls_id to identify same Class with same class name and field definition """ + @wraps(func) def decorater(*args, **kwargs): """ diff --git a/tests/metagpt/actions/test_action_outcls_registry.py b/tests/metagpt/actions/test_action_outcls_registry.py index e949ac16b..eac0ba4d9 100644 --- a/tests/metagpt/actions/test_action_outcls_registry.py +++ b/tests/metagpt/actions/test_action_outcls_registry.py @@ -3,6 +3,7 @@ # @Desc : unittest of action_outcls_registry from typing import List + from metagpt.actions.action_node import ActionNode @@ -18,10 +19,9 @@ def test_action_outcls_registry(): outinst1 = outcls1(**out_data) assert outinst1 == outinst - outcls2 = ActionNode(key="", - expected_type=str, - instruction="", - example="").create_model_class(class_name, out_mapping) + outcls2 = ActionNode(key="", expected_type=str, instruction="", example="").create_model_class( + class_name, out_mapping + ) outinst2 = outcls2(**out_data) assert outinst2 == outinst