]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Fix test range comparison with empty ranges
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 28 Oct 2021 23:36:03 +0000 (01:36 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 28 Oct 2021 23:36:03 +0000 (01:36 +0200)
tests/fix_faker.py

index 36ced9f5e549a3c5b6f3ec3f7436512b390173ac..8a9a3529da525f04781c9233e4ac1233a55ec983 100644 (file)
@@ -719,7 +719,7 @@ class Faker:
                     want.lower, want.upper + unit, want.bounds[0] + ")"
                 )
 
-        if spec[1] == (dt.datetime, True):
+        if spec[1] == (dt.datetime, True) and not want.isempty:
             # work around https://bugs.python.org/issue45347
             def fix_dt(x):
                 return x.astimezone(dt.timezone.utc) if x is not None else None