python-pandas/pandas-1.3.5-5601728.patch

34 lines
1.3 KiB
Diff

diff -Naur pandas-1.3.5-original/pandas/tests/tools/test_to_datetime.py pandas-1.3.5/pandas/tests/tools/test_to_datetime.py
--- pandas-1.3.5-original/pandas/tests/tools/test_to_datetime.py 2021-12-12 05:20:48.000000000 -0500
+++ pandas-1.3.5/pandas/tests/tools/test_to_datetime.py 2022-04-04 18:13:26.346032539 -0400
@@ -44,6 +44,7 @@
from pandas.core.arrays import DatetimeArray
from pandas.core.tools import datetimes as tools
from pandas.core.tools.datetimes import start_caching_at
+from pandas.util.version import Version
class TestTimeConversionFormats:
@@ -761,11 +762,20 @@
@pytest.mark.parametrize("cache", [True, False])
@td.skip_if_no("psycopg2")
- def test_to_datetime_tz_psycopg2(self, cache):
+ def test_to_datetime_tz_psycopg2(self, request, cache):
# xref 8260
import psycopg2
+ # https://www.psycopg.org/docs/news.html#what-s-new-in-psycopg-2-9
+ request.node.add_marker(
+ pytest.mark.xfail(
+ Version(psycopg2.__version__.split()[0]) > Version("2.8.7"),
+ raises=AttributeError,
+ reason="psycopg2.tz is deprecated (and appears dropped) in 2.9",
+ )
+ )
+
# misc cases
tz1 = psycopg2.tz.FixedOffsetTimezone(offset=-300, name=None)
tz2 = psycopg2.tz.FixedOffsetTimezone(offset=-240, name=None)