Update base SCMClient testing for typing and dependency checks.
Review Request #12530 — Created Aug. 16, 2022 and submitted
This updates
SCMClientTestCase
in preparation for the new dependency
support and testing for each SCMClient.
SCMClientTestCase
now uses generics to ensure that thescmclient_cls
being set will be used as the type for allbuild_client()
results,
fixing type checking so that type checkers can match up calls to the
subclass rather than toBaseSCMClient
.
build_client()
has been updated to default to callingsetup()
and to
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 runsetup()
, 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.SpyAgency
is also now part ofSCMClientTestCase
, 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.
Summary | ID |
---|---|
dc509a1d4ed982e6cc35617d0e4af65059ef278c |