Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Aug 21, 2023
1 parent b802834 commit fbf3b8c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
4 changes: 1 addition & 3 deletions tests/test_freshness_date_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def setUp(self):

def now_with_timezone(self, tz):
now = self.now
return datetime(
now.year, now.month, now.day, now.hour, now.minute, tzinfo=tz
)
return datetime(now.year, now.month, now.day, now.hour, now.minute, tzinfo=tz)

@parameterized.expand(
[
Expand Down
18 changes: 15 additions & 3 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,19 +597,31 @@ def test_search_and_parse(self, shortname, string, expected, settings=None):
(
"May 2020",
datetime.datetime(
2020, 5, datetime.datetime.now(tz=datetime.timezone.utc).day, 0, 0
2020,
5,
datetime.datetime.now(tz=datetime.timezone.utc).day,
0,
0,
),
),
(
"July 2020",
datetime.datetime(
2020, 7, datetime.datetime.now(tz=datetime.timezone.utc).day, 0, 0
2020,
7,
datetime.datetime.now(tz=datetime.timezone.utc).day,
0,
0,
),
),
(
"2023",
datetime.datetime(
2023, 7, datetime.datetime.now(tz=datetime.timezone.utc).day, 0, 0
2023,
7,
datetime.datetime.now(tz=datetime.timezone.utc).day,
0,
0,
),
),
(
Expand Down
4 changes: 3 additions & 1 deletion tests/test_timezone_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def given_time(self, utc_dt_string, local_dt_string):
datetime_cls = dateparser.timezone_parser.datetime
if not isinstance(datetime_cls, Mock):
datetime_cls = Mock(wraps=datetime)
utc_dt_obj = datetime.strptime(utc_dt_string, "%Y-%m-%d %H:%M").astimezone(dt.timezone.utc)
utc_dt_obj = datetime.strptime(utc_dt_string, "%Y-%m-%d %H:%M").astimezone(
dt.timezone.utc
)
local_dt_obj = datetime.strptime(local_dt_string, "%Y-%m-%d %H:%M")

def _dt_now(tz=None):
Expand Down

0 comments on commit fbf3b8c

Please sign in to comment.