module documentation
Undocumented
Class | context |
Undocumented |
Class |
|
Test the datetime_exists / datetime_ambiguous functions |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Mix-in class for testing ambiguous times |
Class |
|
Undocumented |
Class |
|
No class docstring; 0/4 constant, 1/17 method documented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Run all the TzPickleTest tests, using a temporary file |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Function | get |
Retrieve a (tzname, utcoffset, dst) tuple for a given DST |
Function | mark |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test_invalid_ |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test_valid_ |
Undocumented |
Constant | DEFAULT |
Undocumented |
Constant | EDT |
Undocumented |
Constant | EST |
Undocumented |
Constant | EUROPE |
Undocumented |
Constant | IS |
Undocumented |
Constant | MISSING |
Undocumented |
Constant | NEW |
Undocumented |
Constant | SUPPORTS |
Undocumented |
Constant | TZFILE |
Undocumented |
Constant | TZICAL |
Undocumented |
Constant | TZICAL |
Undocumented |
Variable | resolve |
Undocumented |
Function | __get |
Undocumented |
@pytest.mark.gettz
@pytest.mark.parametrize( 'badzone', [ 'Fake.Region/Abcdefghijklmnop'])
def test_gettz_badzone(badzone): (source)
@pytest.mark.parametrize(
def test_gettz_badzone(badzone): (source)
Undocumented
@pytest.mark.gettz
@pytest.mark.xfail( IS_WIN, reason='zoneinfo separately cached')
def test_gettz_cache_clear(): (source)
@pytest.mark.xfail(
def test_gettz_cache_clear(): (source)
Undocumented
@pytest.mark.gettz
@pytest.mark.xfail( IS_WIN, reason='zoneinfo separately cached')
def test_gettz_set_cache_size(): (source)
@pytest.mark.xfail(
def test_gettz_set_cache_size(): (source)
Undocumented
@pytest.mark.xfail( IS_WIN, reason='Windows does not use system zoneinfo')
@pytest.mark.smoke
@pytest.mark.gettz
def test_gettz_weakref(): (source)
@pytest.mark.smoke
@pytest.mark.gettz
def test_gettz_weakref(): (source)
Undocumented
@pytest.mark.gettz
@pytest.mark.parametrize( 'badzone,exc_reason', [ pytest.param( b'America/New_York', '.*should be str, not bytes.*', id='bytes on Python 3', marks=[ pytest.mark.skipif( PY2, reason='bytes arguments accepted in Python 2')]), pytest.param( object(), None, id='no startswith()', marks=[ pytest.mark.xfail( reason='AttributeError instead of TypeError', raises=AttributeError)])])
def test_gettz_zone_wrong_type(badzone, exc_reason): (source)
@pytest.mark.parametrize(
def test_gettz_zone_wrong_type(badzone, exc_reason): (source)
Undocumented
@pytest.mark.tzstr
@pytest.mark.parametrize( 'tz_str', [ 'hdfiughdfuig,dfughdfuigpu87ñ::', ',dfughdfuigpu87ñ::', '-1:WART4WARST,J1,J365/25', 'WART4WARST,J1,J365/-25', 'IST-2IDT,M3.4.-1/26,M10.5.0', 'IST-2IDT,M3,2000,1/26,M10,5,0'])
def test_invalid_GNU_tzstr(tz_str): (source)
@pytest.mark.parametrize(
def test_invalid_GNU_tzstr(tz_str): (source)
Undocumented
@pytest.mark.tz_resolve_imaginary
@pytest.mark.parametrize( 'tzi, dt, dt_exp', resolve_imaginary_tests)
def test_resolve_imaginary(tzi, dt, dt_exp): (source)
@pytest.mark.parametrize(
def test_resolve_imaginary(tzi, dt, dt_exp): (source)
Undocumented
@pytest.mark.tz_resolve_imaginary
@pytest.mark.parametrize( 'dt', [ datetime( 2017, 11, 5, 1, 30, tzinfo=tz.gettz( 'America/New_York')), datetime( 2018, 10, 28, 1, 30, tzinfo=tz.gettz( 'Europe/London')), datetime( 2017, 4, 2, 2, 30, tzinfo=tz.gettz( 'Australia/Sydney'))])
def test_resolve_imaginary_ambiguous(dt): (source)
@pytest.mark.parametrize(
def test_resolve_imaginary_ambiguous(dt): (source)
Undocumented
@pytest.mark.tz_resolve_imaginary
@pytest.mark.parametrize( 'dt', [ datetime( 2017, 6, 2, 12, 30, tzinfo=tz.gettz( 'America/New_York')), datetime( 2018, 4, 2, 9, 30, tzinfo=tz.gettz( 'Europe/London')), datetime( 2017, 2, 2, 16, 30, tzinfo=tz.gettz( 'Australia/Sydney')), datetime( 2017, 12, 2, 12, 30, tzinfo=tz.gettz( 'America/New_York')), datetime( 2018, 12, 2, 9, 30, tzinfo=tz.gettz( 'Europe/London')), datetime( 2017, 6, 2, 16, 30, tzinfo=tz.gettz( 'Australia/Sydney')), datetime( 2025, 9, 25, 1, 17, tzinfo=tz.UTC), datetime( 2025, 9, 25, 1, 17, tzinfo=tz.tzoffset( 'EST', -18000)), datetime( 2019, 3, 4, tzinfo=None)])
def test_resolve_imaginary_existing(dt): (source)
@pytest.mark.parametrize(
def test_resolve_imaginary_existing(dt): (source)
Undocumented
@pytest.mark.tzfile
@pytest.mark.skipif( SUPPORTS_SUB_MINUTE_OFFSETS, reason='Sub-minute offsets supported.')
def test_sub_minute_rounding_tzfile(): (source)
@pytest.mark.skipif(
def test_sub_minute_rounding_tzfile(): (source)
Undocumented
@pytest.mark.tzfile
@pytest.mark.skipif( not SUPPORTS_SUB_MINUTE_OFFSETS, reason='Sub-minute offsets not supported')
def test_tzfile_sub_minute_offset(): (source)
@pytest.mark.skipif(
def test_tzfile_sub_minute_offset(): (source)
Undocumented
@mark_tzlocal_nix
@pytest.mark.parametrize( 'tzvar, tzoff', [ ( 'EST5', tz.tzoffset( 'EST', -18000)), ( 'GMT0', tz.tzoffset( 'GMT', 0)), ( 'YAKT-9', tz.tzoffset( 'YAKT', timedelta( hours=9))), ( 'JST-9', tz.tzoffset( 'JST', timedelta( hours=9)))])
def test_tzlocal_offset_equal(tzvar, tzoff): (source)
@pytest.mark.parametrize(
def test_tzlocal_offset_equal(tzvar, tzoff): (source)
Undocumented
@mark_tzlocal_nix
@pytest.mark.parametrize( 'tzvar, tzoff', [ ( 'EST5EDT', tz.tzoffset( 'EST', -18000)), ( 'GMT0BST', tz.tzoffset( 'GMT', 0)), ( 'EST5', tz.tzoffset( 'EST', -14400)), ( 'YAKT-9', tz.tzoffset( 'JST', timedelta( hours=9))), ( 'JST-9', tz.tzoffset( 'YAKT', timedelta( hours=9)))])
def test_tzlocal_offset_unequal(tzvar, tzoff): (source)
@pytest.mark.parametrize(
def test_tzlocal_offset_unequal(tzvar, tzoff): (source)
Undocumented
@mark_tzlocal_nix
@pytest.mark.parametrize( 'tzvar', [ 'UTC', 'GMT0', 'UTC0'])
def test_tzlocal_utc_equal(tzvar): (source)
@pytest.mark.parametrize(
def test_tzlocal_utc_equal(tzvar): (source)
Undocumented
@mark_tzlocal_nix
@pytest.mark.parametrize( 'tzvar', [ 'Europe/London', 'America/New_York', 'GMT0BST', 'EST5EDT'])
def test_tzlocal_utc_unequal(tzvar): (source)
@pytest.mark.parametrize(
def test_tzlocal_utc_unequal(tzvar): (source)
Undocumented
@pytest.mark.parametrize( 'args,kwargs', [ ( ( 'EST', -18000), {}), ( ( 'EST', timedelta( hours=-5)), {}), ( ( 'EST'), { 'offset': -18000}), ( ( 'EST'), { 'offset': timedelta( hours=-5)}), ( tuple(), { 'name': 'EST', 'offset': -18000})])
def test_tzoffset_is(args, kwargs): (source)
def test_tzoffset_is(args, kwargs): (source)
Undocumented
@pytest.mark.tzoffset
@pytest.mark.parametrize( 'args', [ ( 'UTC', 0), ( 'EST', -18000), ( 'EST', timedelta( hours=-5)), ( None, timedelta( hours=3))])
def test_tzoffset_singleton(args): (source)
@pytest.mark.parametrize(
def test_tzoffset_singleton(args): (source)
Undocumented
@pytest.mark.tzoffset
@pytest.mark.skipif( not SUPPORTS_SUB_MINUTE_OFFSETS, reason='Sub-minute offsets not supported')
def test_tzoffset_sub_minute(): (source)
@pytest.mark.skipif(
def test_tzoffset_sub_minute(): (source)
Undocumented
@pytest.mark.tzoffset
@pytest.mark.skipif( SUPPORTS_SUB_MINUTE_OFFSETS, reason='Sub-minute offsets supported')
def test_tzoffset_sub_minute_rounding(): (source)
@pytest.mark.skipif(
def test_tzoffset_sub_minute_rounding(): (source)
Undocumented
@pytest.mark.tzstr
@pytest.mark.parametrize( 'tzstr_1', [ 'EST5EDT', 'EST5EDT4,M4.1.0/02:00:00,M10-5-0/02:00'])
@pytest.mark.parametrize( 'tzstr_2', [ 'EST5EDT', 'EST5EDT4,M4.1.0/02:00:00,M10-5-0/02:00'])
def test_tzstr_default_cmp(tzstr_1, tzstr_2): (source)
@pytest.mark.parametrize(
@pytest.mark.parametrize(
def test_tzstr_default_cmp(tzstr_1, tzstr_2): (source)
Undocumented
@pytest.mark.tzstr
@pytest.mark.parametrize( 'tz_str', DEFAULT_TZSTR_RULES_EQUIV_2003)
def test_tzstr_default_end(tz_str): (source)
@pytest.mark.parametrize(
def test_tzstr_default_end(tz_str): (source)
Undocumented
@pytest.mark.tzstr
@pytest.mark.parametrize( 'tz_str', DEFAULT_TZSTR_RULES_EQUIV_2003)
def test_tzstr_default_start(tz_str): (source)
@pytest.mark.parametrize(
def test_tzstr_default_start(tz_str): (source)
Undocumented
@pytest.mark.tzstr
@pytest.mark.parametrize( 'tz_str, expected', [ ( 'EST5EDT,5,4,0,7200,11,3,0,7200', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( month=5, day=1, weekday=SU( +4), hours=+2), end=relativedelta( month=11, day=1, weekday=SU( +3), hours=+1))), ( 'EST5EDT,5,-4,0,7200,11,3,0,7200', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( hours=+2, month=5, day=31, weekday=SU( -4)), end=relativedelta( hours=+1, month=11, day=1, weekday=SU( +3)))), ( 'EST5EDT,5,4,0,7200,11,-3,0,7200', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( hours=+2, month=5, day=1, weekday=SU( +4)), end=relativedelta( hours=+1, month=11, day=31, weekday=SU( -3)))), ( 'EST5EDT,5,4,0,7200,11,-3,0,7200,3600', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( hours=+2, month=5, day=1, weekday=SU( +4)), end=relativedelta( hours=+1, month=11, day=31, weekday=SU( -3)))), ( 'EST5EDT,5,4,0,7200,11,-3,0,7200,3600', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( hours=+2, month=5, day=1, weekday=SU( +4)), end=relativedelta( hours=+1, month=11, day=31, weekday=SU( -3)))), ( 'EST5EDT,5,4,0,7200,11,-3,0,7200,-3600', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', timedelta( hours=-6), start=relativedelta( hours=+2, month=5, day=1, weekday=SU( +4)), end=relativedelta( hours=+3, month=11, day=31, weekday=SU( -3)))), ( 'EST5EDT,5,4,0,7200,11,-3,0,7200,+7200', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', timedelta( hours=-3), start=relativedelta( hours=+2, month=5, day=1, weekday=SU( +4)), end=relativedelta( hours=0, month=11, day=31, weekday=SU( -3)))), ( 'EST5EDT,5,4,0,7200,11,-3,0,7200,+3600', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( hours=+2, month=5, day=1, weekday=SU( +4)), end=relativedelta( hours=+1, month=11, day=31, weekday=SU( -3))))])
def test_valid_dateutil_format(tz_str, expected): (source)
@pytest.mark.parametrize(
def test_valid_dateutil_format(tz_str, expected): (source)
Undocumented
@pytest.mark.tzstr
@pytest.mark.parametrize( 'tz_str,expected', [ ( '', tz.tzrange( None)), ( 'EST+5EDT,M3.2.0/2,M11.1.0/12', tz.tzrange( 'EST', -18000, 'EDT', -14400, start=relativedelta( month=3, day=1, weekday=SU( 2), hours=2), end=relativedelta( month=11, day=1, weekday=SU( 1), hours=11))), ( 'WART4WARST,J1/0,J365/25', tz.tzrange( 'WART', timedelta( hours=-4), 'WARST', start=relativedelta( month=1, day=1, hours=0), end=relativedelta( month=12, day=31, days=1))), ( 'IST-2IDT,M3.4.4/26,M10.5.0', tz.tzrange( 'IST', timedelta( hours=2), 'IDT', start=relativedelta( month=3, day=1, weekday=TH( 4), days=1, hours=2), end=relativedelta( month=10, day=31, weekday=SU( -1), hours=1))), ( 'WGT3WGST,M3.5.0/2,M10.5.0/1', tz.tzrange( 'WGT', timedelta( hours=-3), 'WGST', start=relativedelta( month=3, day=31, weekday=SU( -1), hours=2), end=relativedelta( month=10, day=31, weekday=SU( -1), hours=0))), ( 'WGT0300WGST', tz.tzrange( 'WGT', timedelta( hours=-3), 'WGST')), ( 'WGT03:00WGST', tz.tzrange( 'WGT', timedelta( hours=-3), 'WGST')), ( 'AEST-1100AEDT', tz.tzrange( 'AEST', timedelta( hours=11), 'AEDT')), ( 'AEST-11:00AEDT', tz.tzrange( 'AEST', timedelta( hours=11), 'AEDT')), ( 'EST5EDT,M3.2.0/4:00,M11.1.0/3:00', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( month=3, day=1, weekday=SU( 2), hours=4), end=relativedelta( month=11, day=1, weekday=SU( 1), hours=2))), ( 'EST5EDT,M3.2.0/04:00,M11.1.0/03:00', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( month=3, day=1, weekday=SU( 2), hours=4), end=relativedelta( month=11, day=1, weekday=SU( 1), hours=2))), ( 'EST5EDT,M3.2.0/0400,M11.1.0/0300', tz.tzrange( 'EST', timedelta( hours=-5), 'EDT', start=relativedelta( month=3, day=1, weekday=SU( 2), hours=4), end=relativedelta( month=11, day=1, weekday=SU( 1), hours=2)))])
def test_valid_GNU_tzstr(tz_str, expected): (source)
@pytest.mark.parametrize(
def test_valid_GNU_tzstr(tz_str, expected): (source)
Undocumented
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|