Skip to content

Commit

Permalink
Use standard library UTC tzinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJCLaw committed Aug 4, 2024
1 parent 0a85a3d commit 69c4423
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion sr/comp/yaml_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from typing import Any

import dateutil.parser
import dateutil.tz
import yaml

from .types import YAMLData
Expand Down
4 changes: 2 additions & 2 deletions tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from collections.abc import Iterable, Mapping, Sequence
from typing import TypeVar

from dateutil.tz import UTC

from sr.comp.match_period import Match, MatchType
from sr.comp.types import (
ArenaName,
Expand All @@ -17,6 +15,8 @@
TLA,
)

UTC = datetime.timezone.utc

T = TypeVar('T')


Expand Down
14 changes: 8 additions & 6 deletions tests/test_winners.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import datetime
import unittest
from collections import OrderedDict
from datetime import datetime
from pathlib import Path
from unittest import mock

from dateutil.tz import UTC
from league_ranker import calc_positions, calc_ranked_points

from sr.comp.arenas import ArenaName
Expand All @@ -14,13 +13,16 @@
from sr.comp.types import MatchNumber, TLA
from sr.comp.winners import Award, compute_awards

UTC = datetime.timezone.utc


FINAL_INFO = Match(
num=MatchNumber(1),
display_name="Match 1",
arena=ArenaName('A'),
teams=[TLA('AAA'), TLA('BBB'), TLA('CCC'), TLA('DDD')],
start_time=datetime(2014, 4, 26, 16, 30, tzinfo=UTC),
end_time=datetime(2014, 4, 26, 16, 35, tzinfo=UTC),
start_time=datetime.datetime(2014, 4, 26, 16, 30, tzinfo=UTC),
end_time=datetime.datetime(2014, 4, 26, 16, 35, tzinfo=UTC),
type=MatchType.knockout,
use_resolved_ranking=False,
)
Expand All @@ -30,8 +32,8 @@
display_name="Tiebreaker (#2)",
arena=ArenaName('A'),
teams=[TLA('AAA'), TLA('BBB')],
start_time=datetime(2014, 4, 26, 16, 30, tzinfo=UTC),
end_time=datetime(2014, 4, 26, 16, 35, tzinfo=UTC),
start_time=datetime.datetime(2014, 4, 26, 16, 30, tzinfo=UTC),
end_time=datetime.datetime(2014, 4, 26, 16, 35, tzinfo=UTC),
type=MatchType.tiebreaker,
use_resolved_ranking=False,
)
Expand Down

0 comments on commit 69c4423

Please sign in to comment.