def test_tz_class(): tzi = rdt.TzClass() dt = pdt.datetime(2018, 1, 1, tzinfo=tzi) assert dt.tzname() == "+01:00" assert dt.utcoffset() == pdt.timedelta(hours=1) assert dt.dst() is None
def test_tz_class_introspection(): tzi = rdt.TzClass() assert tzi.__class__ == rdt.TzClass # PyPy generates <importlib.bootstrap.TzClass ...> for some reason. assert re.match(r"^<[\w\.]*TzClass object at", repr(tzi))