move renaming backports.zoneinfo.ZoneInfo to zoneinfo.ZoneInfo into conftest.py

pull/623/head
Nicco Kunzmann 2024-06-07 18:15:56 +01:00
rodzic 21211cc958
commit b920876d8c
2 zmienionych plików z 9 dodań i 13 usunięć

Wyświetl plik

@ -1,13 +1,18 @@
try:
from backports import zoneinfo
# we make the tests nicer
class ZoneInfo(zoneinfo.ZoneInfo):
def __repr__(self):
return f"zoneinfo.ZoneInfo(key={repr(self.key)})"
zoneinfo.ZoneInfo = ZoneInfo
except ImportError:
pass
import os
import pytest
import icalendar
import pytz
from datetime import datetime
from dateutil import tz
try:
import zoneinfo
except ModuleNotFoundError:
from backports import zoneinfo
from icalendar.cal import Component, Calendar, Event, ComponentFactory
from icalendar.timezone import tzp as _tzp
from icalendar.timezone import TZP

Wyświetl plik

@ -14,15 +14,6 @@ import doctest
import os
import pytest
import importlib
try:
from backports import zoneinfo
# we make the tests nicer
class ZoneInfo(zoneinfo.ZoneInfo):
def __repr__(self):
return f"zoneinfo.ZoneInfo(key={repr(self.key)})"
zoneinfo.ZoneInfo = ZoneInfo
except ImportError:
pass
HERE = os.path.dirname(__file__) or "."
ICALENDAR_PATH = os.path.dirname(HERE)