From: Daniele Varrazzo Date: Tue, 29 Jun 2021 03:41:07 +0000 (+0100) Subject: Skip tests requiring an IANA db on Windows X-Git-Tag: 3.0.dev0~4^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=087c2f5e6ceb3f82a8cf0149278de4549ee4e580;p=thirdparty%2Fpsycopg.git Skip tests requiring an IANA db on Windows --- diff --git a/tests/test_conninfo.py b/tests/test_conninfo.py index d1a44501d..563e7d451 100644 --- a/tests/test_conninfo.py +++ b/tests/test_conninfo.py @@ -1,3 +1,4 @@ +import sys import datetime as dt import pytest @@ -230,6 +231,9 @@ class TestConnectionInfo: with pytest.raises(psycopg.OperationalError): conn.info.backend_pid + @pytest.mark.skipif( + sys.platform == "win32", reason="no IANA db on Windows" + ) def test_timezone(self, conn): conn.execute("set timezone to 'Europe/Rome'") tz = conn.info.timezone diff --git a/tests/types/test_datetime.py b/tests/types/test_datetime.py index 55a819169..2e91a79b2 100644 --- a/tests/types/test_datetime.py +++ b/tests/types/test_datetime.py @@ -1,3 +1,4 @@ +import sys import datetime as dt import pytest @@ -310,6 +311,8 @@ class TestDateTimeTz: ) @pytest.mark.parametrize("fmt_out", [pq.Format.TEXT, pq.Format.BINARY]) def test_load_datetimetz_tz(self, conn, fmt_out, tzname, expr, tzoff): + if "/" in tzname and sys.platform == "win32": + pytest.skip("no IANA db on Windows") conn.execute("select set_config('TimeZone', %s, true)", [tzname]) cur = conn.cursor(binary=fmt_out) ts = cur.execute("select %s::timestamptz", [expr]).fetchone()[0]