fix `client.GetClassObject` type annotations and add tests
junkmd opened this issue · comments
Jun Komoda commented
Remaining tasks for #456.
comtypes/comtypes/client/__init__.py
Lines 200 to 222 in 18dc2cc
- remove
if TYPE_CHECKING
bridges, like #453. - change type hints from comment annotations to inline annotations, like #453.
- add
TestCase
intest/test_client.py
that callclient.GetClassObject
.- At least one of the tests should use a universal COM library such as those found in CI environments. Please do not use
unittest.mock
whenever possible.
- At least one of the tests should use a universal COM library such as those found in CI environments. Please do not use
- make sure that if passing
Type[_T_IUnknown]
forinterface
, the return value will be analyzed as_T_IUnknown
by static type checkers. - Before PR, please format the code by
black
(the maximum number of characters per line is 88, which is the default).
I hope someone who actually uses client.GetClassObject
will PR along with the introduction of use cases, because I had not use this function.
Jun Komoda commented
This is related to #453.
Since comtypes.CoGetClassObject
is also untested, we should avoid a situation where no tests without using unittest.mock.patch
.