Skip to content

Commit

Permalink
minimal type annotation for tests/conf.py:client
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Nov 6, 2024
1 parent 45126ef commit 47110ed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## Make a conf_private.py for personal configuration.
## Check conf_private.py.EXAMPLE
import logging
from typing import Any
from typing import Optional

from caldav.davclient import DAVClient

Expand Down Expand Up @@ -145,7 +147,7 @@
)


def client(idx=None, **kwargs):
def client(idx: Optional[int] = None, **kwargs: Any) -> DAVClient:
if idx is None and not kwargs:
return client(0)
elif idx is not None and not kwargs and caldav_servers:
Expand All @@ -163,8 +165,9 @@ def client(idx=None, **kwargs):
for kw in kwargs:
if kw not in CONNKEYS:
logging.critical(
"unknown keyword %s in connection parameters. All compatibility flags should now be sent as a separate list, see conf_private.py.EXAMPLE. Ignoring."
% kw
"unknown keyword %s in connection parameters. "
"All compatibility flags should now be sent as a separate list, see conf_private.py.EXAMPLE. Ignoring.",
kw,
)
kwargs.pop(kw)
return DAVClient(**kwargs)

0 comments on commit 47110ed

Please sign in to comment.