Skip to content

Commit

Permalink
docs: better docs wording
Browse files Browse the repository at this point in the history
  • Loading branch information
FlickerSoul committed Nov 22, 2023
1 parent 98a02c8 commit 28f3153
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/Tutorials/Easy-Context.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def custom_test(case: TestCaseWrapper, result_proxy: TestResult, solution, submi
# test if student's adder behaves the same in the solution as in their submission
assert solution(*case.test_param.args, adder) == submission(
*case.test_param.args,
case.context.adder, # access adder from test case
case.context.adder, # case.context.adder is the same as adder
)


Expand Down
23 changes: 1 addition & 22 deletions docs/Tutorials/Test-Result-(Proxy).md
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,7 @@ class TestResult:

## Usage

The signature of a `gap_override_test` function and a `gap_post_check` function are the following, in which the second positional argument is the `TestResult` proxy.

```python

class CustomTestFn(Protocol):
def __call__[T](self, param: TestCaseWrapper, result_proxy: TestResult, expected: T, actual: T) -> None:
...
```

```python
class PostChecksFn(Protocol):
def __call__[T](
self,
param: TestCaseWrapper,
result_proxy: TestResult,
solution: T,
submission: T,
expected_results: Tuple[Any, str | None],
actual_results: Tuple[Any, str | None],
) -> None:
...
```
The functions to `gap_override_test`, `gap_post_hooks`, `gap_pre_hooks`, `pre_tests` and `post_tests` all need an input of `TestResult` type. See [this page](./Various-Function-Protocols.md) for their signatures.

You can set the result attributes using `set_<attribute>()` function. For example,

Expand Down
2 changes: 0 additions & 2 deletions docs/Tutorials/Various-Function-Protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
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`

::: gapper.core.utils.CustomTestFn


## `gap_override_check`
::: gapper.core.utils.CustomEqualityCheckFn

Expand Down

0 comments on commit 28f3153

Please sign in to comment.