From 98a02c83cac96ff15af972120f3164387cc06117 Mon Sep 17 00:00:00 2001 From: Heyuan Zeng Date: Wed, 22 Nov 2023 02:08:25 +0000 Subject: [PATCH] fix: signature and export --- src/gapper/__init__.py | 3 ++- src/gapper/core/test_parameter.py | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gapper/__init__.py b/src/gapper/__init__.py index e974cff..28582c7 100644 --- a/src/gapper/__init__.py +++ b/src/gapper/__init__.py @@ -16,7 +16,7 @@ ) from .core.test_result import TestResult from .core.tester import post_tests, pre_tests -from .core.unittest_wrapper import post_hook, pre_hook +from .core.unittest_wrapper import TestCaseWrapper, post_hook, pre_hook from .gradescope.datatypes.gradescope_meta import GradescopeSubmissionMetadata __all__ = [ @@ -39,4 +39,5 @@ "pre_tests", "TestResult", "GradescopeSubmissionMetadata", + "TestCaseWrapper", ] diff --git a/src/gapper/core/test_parameter.py b/src/gapper/core/test_parameter.py index 251f832..7b0db74 100644 --- a/src/gapper/core/test_parameter.py +++ b/src/gapper/core/test_parameter.py @@ -186,10 +186,6 @@ def __new__( gap_is_pipeline: bool | Sequence[bool] = False, gap_max_score: float | Sequence[float] | None = None, gap_weight: float | Sequence[float] | None = None, - gap_params: bool = False, - gap_param_iter: bool = False, - gap_singular_params: bool = False, - gap_singular_param_iter: bool = False, **kwargs: Any, ) -> None: ... @@ -237,10 +233,11 @@ def __init__( :param gap_override_check: The custom equality check function. :param gap_easy_context: Whether to use context directly in gap override tests. :param gap_override_test: The custom test function. - :param gap_post_hooks: The custom post check functions. + :param gap_pre_hooks: The custom functions run before tests. + :param gap_post_hooks: The custom functions run after tests. :param gap_description: The description of the test case. :param gap_is_pipeline: Whether the test case is a pipeline. - :param gap_max_score: The max score of the test case. + :param gap_max_score: The max score of the test case. This and gap_weight cannot be specified as the same ti :param kwargs: The keyword arguments for the test parameter, including kwargs. """ @@ -274,10 +271,11 @@ def __init__( :param gap_override_check: The custom equality check function. :param gap_easy_context: Whether to use context directly in gap override tests. :param gap_override_test: The custom test function. - :param gap_post_hooks: The custom post check functions. + :param gap_pre_hooks: The custom functions run before tests. + :param gap_post_hooks: The custom functions run after tests. :param gap_description: The description of the test case. :param gap_is_pipeline: Whether the test case is a pipeline. - :param gap_weight: The weight of the test case. + :param gap_weight: The weight of the test case. This and gap_max_score cannot be specified as the same time. :param kwargs: The keyword arguments for the test parameter, including kwargs. """ @@ -529,7 +527,7 @@ def __init__( :param kwargs: The keyword arguments for the test parameter bundle. .. seealso:: :class:`gapper.core.test_parameter.TestParam` - seealso:: + .. seealso:: :class:`gapper.core.test_parameter.ParamExtractor` """ if (