From: Denis Laxalde Date: Thu, 28 Oct 2021 08:55:21 +0000 (+0200) Subject: Add a couple of "# type: ignore" in datetime tests X-Git-Tag: 3.0.2~6^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d5fe7e70ae89f34dea8d0a0338533333f48eccc;p=thirdparty%2Fpsycopg.git Add a couple of "# type: ignore" in datetime tests Mypy cannot check map() calls on split-strings. --- diff --git a/tests/types/test_datetime.py b/tests/types/test_datetime.py index a5484db72..7d51cfa02 100644 --- a/tests/types/test_datetime.py +++ b/tests/types/test_datetime.py @@ -672,7 +672,10 @@ def as_time(s): else: off = None - rv = dt.time(*map(int, s.split(","))) if "," in s else getattr(dt.time, s) + if "," in s: + rv = dt.time(*map(int, s.split(","))) # type: ignore[arg-type] + else: + rv = getattr(dt.time, s) if off: rv = rv.replace(tzinfo=as_tzinfo(off)) @@ -692,7 +695,7 @@ def as_dt(s): def as_naive_dt(s): if "," in s: - rv = dt.datetime(*map(int, s.split(","))) + rv = dt.datetime(*map(int, s.split(","))) # type: ignore[arg-type] else: rv = getattr(dt.datetime, s)