(datetime.timedelta(0), "UTC"),
(datetime.timedelta(hours=5), "UTC+05:00"),
(datetime.timedelta(hours=5, minutes=10), "UTC+05:10"),
- (datetime.timedelta(hours=5, minutes=10, seconds=27), "UTC+05:10:27"),
+ (
+ datetime.timedelta(hours=5, minutes=10, seconds=27),
+ "UTC+05:10:27",
+ testing.requires.granular_timezone,
+ ),
(datetime.timedelta(hours=-3, minutes=10), "UTC-02:50"),
(
datetime.timedelta(
hours=5, minutes=10, seconds=27, microseconds=550
),
"UTC+05:10:27.000550",
+ testing.requires.granular_timezone,
),
)
def test_tzname(self, td, expected):
"Python issue 8743 fixed in Python 2.7.8",
)
+ @property
+ def granular_timezone(self):
+ """the datetime.timezone class, or SQLAlchemy's port, supports
+ seconds and microseconds.
+
+ SQLAlchemy ported the Python 3.7 version for Python 2, so
+ it passes on that. For Python 3.6 and earlier, it is not supported.
+
+ """
+ return exclusions.skip_if(
+ lambda: sys.version_info >= (3,) and sys.version_info < (3, 7)
+ )
+
@property
def selectone(self):
"""target driver must support the literal statement 'select 1'"""