ldt = tz.fromutc(udt.replace(tzinfo=tz))
self.assertEqual(ldt.fold, 0)
+ @unittest.skipUnless(
+ hasattr(time, "tzset"), "time module has no attribute tzset"
+ )
def test_system_transitions(self):
if ('Riyadh8' in self.zonename or
# From tzdata NEWS file:
"LocaleTime().timezone has duplicate values and "
"time.daylight but timezone value not set to -1")
+ @unittest.skipUnless(
+ hasattr(time, "tzset"), "time module has no attribute tzset"
+ )
def test_bad_timezone(self):
# Explicitly test possibility of bad timezone;
# when time.tzname[0] == time.tzname[1] and time.daylight
'perf_counter',
'process_time',
'time',
- 'thread_time',
]
+ if hasattr(time, 'thread_time'):
+ clocks.append('thread_time')
for name in clocks:
with self.subTest(name=name):
return 0;
}
-#elif defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
+#elif defined(HAVE_CLOCK_GETTIME) && \
+ defined(CLOCK_PROCESS_CPUTIME_ID) && \
+ !defined(__EMSCRIPTEN__)
#define HAVE_THREAD_TIME
#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability)