Skip to content

Commit f0e9d56

Browse files
authored
Merge pull request #183 from plotly/andrew/fix_tests
Andrew/fix tests
2 parents 325982f + 2372214 commit f0e9d56

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/test_serializer.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from datetime import UTC, datetime
1+
try:
2+
from datetime import UTC, datetime
3+
except ImportError:
4+
from datetime import datetime, timezone
5+
6+
UTC = timezone.utc
27

38
import logistro
49
import numpy as np
@@ -25,10 +30,12 @@ async def test_de_serialize():
2530
message = wire.serialize(data)
2631
assert message == expected_message
2732
obj = wire.deserialize(message)
28-
for o, t in zip(obj, converted_type, strict=False):
33+
assert len(obj) == len(converted_type)
34+
for o, t in zip(obj, converted_type):
2935
assert isinstance(o, t)
3036
message_np = wire.serialize(np.array(data))
3137
assert message_np == expected_message
3238
obj_np = wire.deserialize(message_np)
33-
for o, t in zip(obj_np, converted_type, strict=False):
39+
assert len(obj_np) == len(converted_type)
40+
for o, t in zip(obj_np, converted_type):
3441
assert isinstance(o, t)

0 commit comments

Comments
 (0)