Update base SCMClient testing for typing and dependency checks.
Review Request #12530 — Created Aug. 16, 2022 and submitted — Latest diff uploaded
SCMClientTestCasein preparation for the new dependency
support and testing for each SCMClient.
SCMClientTestCasenow uses generics to ensure that the
being set will be used as the type for all
fixing type checking so that type checkers can match up calls to the
subclass rather than to
build_client()has been updated to default to calling
handle dependency errors. If a dependency error is encountered, the test
will be skipped automatically. This means we won't need to test for the
dependencies in each test suite anymore, simplifying things.
Unit tests can tell
build_client()not to run
setup(), not to check
for dependencies, and not to skip if encountering a dependency error.
This will aid in testing of the dependency checks themselves.
kgb.SpyAgencyis also now part of
SCMClientTestCase, as it's needed
to skip dependency checks. It has been removed from all subclasses.
All unit tests pass on Python 3.7-3.11.