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:
parent
270080bd56
commit
a5643206a0
15 changed files with 269 additions and 233 deletions
|
@ -29,7 +29,6 @@ from typing import Iterator, List
|
|||
|
||||
from my.core import make_logger
|
||||
from my.core.compat import bisect_left
|
||||
from my.ip.all import ips
|
||||
from my.location.common import Location
|
||||
from my.location.fallback.common import FallbackLocation, DateExact, _datetime_timestamp
|
||||
|
||||
|
@ -37,6 +36,9 @@ logger = make_logger(__name__, level="warning")
|
|||
|
||||
|
||||
def fallback_locations() -> Iterator[FallbackLocation]:
|
||||
# prefer late import since ips get overridden in tests
|
||||
from my.ip.all import ips
|
||||
|
||||
dur = config.for_duration.total_seconds()
|
||||
for ip in ips():
|
||||
lat, lon = ip.latlon
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue