def test_py36_isoformat_invalid(): with pytest.raises(ValueError): _fromisoformat_py36('not a datetime')
def test_py36_isoformat_microsecs(dt): s = dt.isoformat() assert _fromisoformat_py36(s) == dt
def test_py36_isoformat_seconds(dt): rounded_dt = dt.replace(microsecond=0) s = rounded_dt.isoformat() assert _fromisoformat_py36(s) == rounded_dt
def test_py36_isoformat_tz_punct(): _fromisoformat_py36('2020-12-31T11:22:33+10:30')