6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2025-01-05 23:20:40 +00:00
tutor/tests
Régis Behmo 33e4f33afe feat: strongly typed hooks
Now that the mypy bugs have been resolved, we are able to define more precisely
and cleanly the types of Actions and Filters.

Moreover, can now strongly type named actions and hooks (in consts.py). With
such a strong typing, we get early alerts of hooks called with incorrect
arguments, which is nothing short of awesome :)

This change breaks the hooks API by removing the `context=...` argument. The
reason for that is that we cannot insert arbitrary arguments between `P.args,
P.kwargs`: https://peps.python.org/pep-0612/#the-components-of-a-paramspec

> A function declared as def inner(a: A, b: B, *args: P.args, **kwargs:
> P.kwargs) -> R has type Callable[Concatenate[A, B, P], R]. Placing
> keyword-only parameters between the *args and **kwargs is forbidden.

Getting the documentation to build in nitpicky mode is quite difficult... We
need to add `nitpick_ignore` to the docs conf.py, otherwise sphinx complains
about many missing class references. This, despite upgrading almost all doc
requirements (except docutils).
2022-11-15 14:58:36 +01:00
..
commands fix: bind-mount in dev-specific services 2022-07-29 19:53:02 +02:00
hooks feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
__init__.py Add unit tests! yay! 2019-03-23 16:16:44 -07:00
helpers.py feat: migrate to plugins.v1 with filters & actions 2022-04-15 15:30:54 +02:00
openedx-lms-common-settings Better dev environment 2019-10-24 20:03:36 +02:00
test_bindmounts.py fix: crash during local quickstart -p 2021-05-07 17:01:09 +02:00
test_config.py feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
test_env.py feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
test_images.py refactor: add code coverage, cover CLI commands with tests 2022-01-04 13:40:33 +01:00
test_jobs.py fix: unit tests with v1 plugin installed 2022-04-20 19:48:21 +02:00
test_plugins_v0.py feat: migrate to plugins.v1 with filters & actions 2022-04-15 15:30:54 +02:00
test_serialize.py fix: YamlParamType supports line terminators 2021-04-25 09:14:21 +02:00
test_utils.py fix: accurately log shell commands when running jobs 2022-07-25 22:46:53 +02:00