general: make time.tz.via_location user config lazy, move tests to my.tests package

also gets rid of the problematic reset_modules thingie
This commit is contained in:
Dima Gerasimov 2024-08-26 02:00:51 +01:00 committed by karlicoss
parent 270080bd56
commit a5643206a0
15 changed files with 269 additions and 233 deletions

View file

@ -19,7 +19,7 @@ def _calendar():
# todo switch to using time.tz.main once _get_tz stabilizes?
from ..time.tz import via_location as LTZ
# TODO would be nice to do it dynamically depending on the past timezones...
tz = LTZ._get_tz(datetime.now())
tz = LTZ.get_tz(datetime.now())
assert tz is not None
zone = tz.zone; assert zone is not None
code = zone_to_countrycode(zone)