@@ -28,7 +28,7 @@ from cassandra.buffer cimport Buffer
28
28
from cassandra.deserializers cimport from_binary, Deserializer
29
29
30
30
31
- def test_datetype (assert_equal ):
31
+ def test_datetype ():
32
32
33
33
cdef Deserializer des = find_deserializer(DateType)
34
34
@@ -52,27 +52,27 @@ def test_datetype(assert_equal):
52
52
# deserialize
53
53
# epoc
54
54
expected = 0
55
- assert_equal( deserialize(expected), datetime.datetime.fromtimestamp(expected, tz = datetime.timezone.utc).replace(tzinfo = None ) )
55
+ assert deserialize(expected)== datetime.datetime.fromtimestamp(expected, tz = datetime.timezone.utc).replace(tzinfo = None )
56
56
57
57
# beyond 32b
58
58
expected = 2 ** 33
59
- assert_equal( deserialize(expected), datetime.datetime(2242 , 3 , 16 , 12 , 56 , 32 ) )
59
+ assert deserialize(expected)== datetime.datetime(2242 , 3 , 16 , 12 , 56 , 32 )
60
60
61
61
# less than epoc (PYTHON-119)
62
62
expected = - 770172256
63
- assert_equal( deserialize(expected), datetime.datetime(1945 , 8 , 5 , 23 , 15 , 44 ) )
63
+ assert deserialize(expected)== datetime.datetime(1945 , 8 , 5 , 23 , 15 , 44 )
64
64
65
65
# work around rounding difference among Python versions (PYTHON-230)
66
66
# This wont pass with the cython extension until we fix the microseconds alignment with CPython
67
67
# expected = 1424817268.274
68
- # assert_equal( deserialize(expected), datetime.datetime(2015, 2, 24, 22, 34, 28, 274000) )
68
+ # assert deserialize(expected) == datetime.datetime(2015, 2, 24, 22, 34, 28, 274000)
69
69
70
70
# Large date overflow (PYTHON-452)
71
71
expected = 2177403010.123
72
- assert_equal( deserialize(expected), datetime.datetime(2038 , 12 , 31 , 10 , 10 , 10 , 123000 ) )
72
+ assert deserialize(expected)== datetime.datetime(2038 , 12 , 31 , 10 , 10 , 10 , 123000 )
73
73
74
74
75
- def test_date_side_by_side (assert_equal ):
75
+ def test_date_side_by_side ():
76
76
# Test pure python and cython date deserialization side-by-side
77
77
# This is meant to detect inconsistent rounding or conversion (PYTHON-480 for example)
78
78
# The test covers the full range of time deserializable in Python. It bounds through
@@ -91,7 +91,7 @@ def test_date_side_by_side(assert_equal):
91
91
buf.size = bior.size
92
92
cython_deserialized = from_binary(cython_deserializer, & buf, 0 )
93
93
python_deserialized = DateType.deserialize(blob, 0 )
94
- assert_equal( cython_deserialized, python_deserialized)
94
+ assert cython_deserialized== python_deserialized
95
95
96
96
# min -> 0
97
97
x = int (calendar.timegm(datetime.datetime(1 , 1 , 1 ).utctimetuple()) * 1000 )
0 commit comments