misc: replace uses of pytz.utc with timezone.utc where it makes sense
This commit is contained in:
parent
c91534b966
commit
c12224af74
9 changed files with 24 additions and 42 deletions
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from itertools import islice
|
||||
import pytz
|
||||
|
||||
|
@ -43,7 +43,7 @@ def test_myactivity_search() -> None:
|
|||
results = list(read_html(tpath, path))
|
||||
|
||||
res = (
|
||||
datetime(year=2018, month=12, day=17, hour=8, minute=16, second=18, tzinfo=pytz.utc),
|
||||
datetime(year=2018, month=12, day=17, hour=8, minute=16, second=18, tzinfo=timezone.utc),
|
||||
'https://en.wikipedia.org/wiki/Emmy_Noether&usg=AFQjCNGrSW-iDnVA2OTcLsG3I80H_a6y_Q',
|
||||
'Emmy Noether - Wikipedia',
|
||||
)
|
||||
|
|
|
@ -3,11 +3,9 @@ from my.tests.common import skip_if_not_karlicoss as pytestmark
|
|||
# should make lazy loading the default..
|
||||
|
||||
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
import json
|
||||
|
||||
import pytz
|
||||
|
||||
|
||||
def test_tweet() -> None:
|
||||
from my.twitter.archive import Tweet
|
||||
|
@ -45,7 +43,7 @@ def test_tweet() -> None:
|
|||
"""
|
||||
t = Tweet(json.loads(raw), screen_name='whatever')
|
||||
assert t.permalink is not None
|
||||
assert t.dt == datetime(year=2012, month=8, day=30, hour=7, minute=12, second=48, tzinfo=pytz.utc)
|
||||
assert t.dt == datetime(year=2012, month=8, day=30, hour=7, minute=12, second=48, tzinfo=timezone.utc)
|
||||
assert t.text == 'this is a test tweet'
|
||||
assert t.tid == '2328934829084'
|
||||
assert t.entities is not None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue