Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c79be1f

Browse files
Lorak-mmkdkropachev
authored andcommitted
cython/test_types: Use plain asserts
1 parent 4452fa4 commit c79be1f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

‎tests/unit/cython/test_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class TypesTest(unittest.TestCase):
2222

2323
@cythontest
2424
def test_datetype(self):
25-
types_testhelper.test_datetype(self.assertEqual)
25+
types_testhelper.test_datetype()
2626

2727
@cythontest
2828
def test_date_side_by_side(self):
29-
types_testhelper.test_date_side_by_side(self.assertEqual)
29+
types_testhelper.test_date_side_by_side()

‎tests/unit/cython/types_testhelper.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ from cassandra.buffer cimport Buffer
2828
from cassandra.deserializers cimport from_binary, Deserializer
2929

3030

31-
def test_datetype(assert_equal):
31+
def test_datetype():
3232

3333
cdef Deserializer des = find_deserializer(DateType)
3434

@@ -52,27 +52,27 @@ def test_datetype(assert_equal):
5252
# deserialize
5353
# epoc
5454
expected = 0
55-
assert_equal(deserialize(expected), datetime.datetime.fromtimestamp(expected, tz=datetime.timezone.utc).replace(tzinfo=None))
55+
assertdeserialize(expected)==datetime.datetime.fromtimestamp(expected, tz=datetime.timezone.utc).replace(tzinfo=None)
5656

5757
# beyond 32b
5858
expected = 2 ** 33
59-
assert_equal(deserialize(expected), datetime.datetime(2242, 3, 16, 12, 56, 32))
59+
assertdeserialize(expected)==datetime.datetime(2242, 3, 16, 12, 56, 32)
6060

6161
# less than epoc (PYTHON-119)
6262
expected = -770172256
63-
assert_equal(deserialize(expected), datetime.datetime(1945, 8, 5, 23, 15, 44))
63+
assertdeserialize(expected)==datetime.datetime(1945, 8, 5, 23, 15, 44)
6464

6565
# work around rounding difference among Python versions (PYTHON-230)
6666
# This wont pass with the cython extension until we fix the microseconds alignment with CPython
6767
#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)
6969

7070
# Large date overflow (PYTHON-452)
7171
expected = 2177403010.123
72-
assert_equal(deserialize(expected), datetime.datetime(2038, 12, 31, 10, 10, 10, 123000))
72+
assertdeserialize(expected)==datetime.datetime(2038, 12, 31, 10, 10, 10, 123000)
7373

7474

75-
def test_date_side_by_side(assert_equal):
75+
def test_date_side_by_side():
7676
# Test pure python and cython date deserialization side-by-side
7777
# This is meant to detect inconsistent rounding or conversion (PYTHON-480 for example)
7878
# 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):
9191
buf.size = bior.size
9292
cython_deserialized = from_binary(cython_deserializer, &buf, 0)
9393
python_deserialized = DateType.deserialize(blob, 0)
94-
assert_equal(cython_deserialized, python_deserialized)
94+
assertcython_deserialized==python_deserialized
9595

9696
# min -> 0
9797
x = int(calendar.timegm(datetime.datetime(1, 1, 1).utctimetuple()) * 1000)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /