Various Function Protocols¶
It can be confusing to remember all function protocols used in gapper. Below, we list the function signatures and their docstrings for each use case.
gap_override_test
¶
CustomTestFn ¶
Bases: Protocol
The function type to be called for custom tests.
Source code in src/gapper/core/types.py
__call__ ¶
Implement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | CustomTestData[T] | The CustomTestData instance. | required |
Raises:
Type | Description |
---|---|
AssertionError | It should raise assertion error if test fails. |
gap_override_check
¶
CustomEqualityCheckFn ¶
Bases: Protocol
The function type to be called for custom equality checks.
Source code in src/gapper/core/types.py
__call__ ¶
Implement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | CustomEqualityTestData[T] | The CustomEqualityTestData instance. | required |
Raises:
Type | Description |
---|---|
AssertionError | It should raise assertion error if the equality check tails |
gap_pre_hook
¶
PreHookFn ¶
Bases: Protocol
The function type to be called for post checks all the equality check of a test case.
Source code in src/gapper/core/types.py
__call__ ¶
Implement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | PreHookData[T] | The PreTestHookData instance. | required |
Raises:
Type | Description |
---|---|
AssertionError | It should raise assertion error if the pre hook fails. |
gap_post_hook
¶
PostHookFn ¶
Bases: Protocol
The function type to be called for post checks all the equality check of a test case.
Source code in src/gapper/core/types.py
__call__ ¶
Implement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | PostHookData[T] | The PostTestHookData instance. | required |
Raises:
Type | Description |
---|---|
AssertionError | It should raise assertion error if the post hook fails. |
PostHookData dataclass
¶
Bases: HookDataBase
, _TCMixin
, _SolSubMixin[T]
, _SolSubResultMixin[T]
Source code in src/gapper/core/types.py
pre_tests
¶
PreTestsFn ¶
Bases: Protocol
Source code in src/gapper/core/types.py
__call__ ¶
Implement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | PreTestsData | The PreTestsData instance. | required |
Raises:
Type | Description |
---|---|
AssertionError | It should raise assertion error if the pre tests hook fail. |
post_tests
¶
PostTestsFn ¶
Bases: Protocol
The function type to be called after all tests are run.
Source code in src/gapper/core/types.py
__call__ ¶
Implement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | PostTestsData | The PostTestsData instance. | required |
Raises:
Type | Description |
---|---|
AssertionError | It should raise assertion error if the post tests hook fail. |