You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Over the year of active development, the tests are in a clumsy state with lots of inconsistencies. It is time to refactor them (with one or more iterations).
Proposal
The following is a collection of things to improve. Feel free to add ideas to comments.
Get rid of mocks where possible. Use dependency injections.
Add the tests for version upgrades.
Extract the testing tools as project-local plugins, add type-checks to the tooling (not exposed for the users like kopf.testing!).
Wrap various dicts/values in tests with proper classes, to remove IDE typing warnings.
(?) Add typing to pytest fixtures in the tests (for IDEs).
(?) Run mypy over the tests (non-strict, perhaps).
Switch assertions of function calls to assert ...call_args_list == [call(*args, **kwargs)] syntax (now: assert k8s_mocked.sleep_or_wait.call_args_list[0][0][0] is None)
The text was updated successfully, but these errors were encountered:
Problem
Over the year of active development, the tests are in a clumsy state with lots of inconsistencies. It is time to refactor them (with one or more iterations).
Proposal
The following is a collection of things to improve. Feel free to add ideas to comments.
kopf.testing
!).mypy
over the tests (non-strict, perhaps).assert ...call_args_list == [call(*args, **kwargs)]
syntax (now:assert k8s_mocked.sleep_or_wait.call_args_list[0][0][0] is None
)The text was updated successfully, but these errors were encountered: