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 83671d8

Browse files
Lorak-mmkdkropachev
authored andcommitted
bytesio_testhelper: Use plain asserts for equality testing
1 parent d3cfd9f commit 83671d8

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

‎tests/unit/cython/bytesio_testhelper.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414

1515
from cassandra.bytesio cimport BytesIOReader
1616

17-
def test_read1(assert_equal, assert_raises):
17+
def test_read1(assert_raises):
1818
cdef BytesIOReader reader = BytesIOReader(b'abcdef')
19-
assert_equal(reader.read(2)[:2], b'ab')
20-
assert_equal(reader.read(2)[:2], b'cd')
21-
assert_equal(reader.read(0)[:0], b'')
22-
assert_equal(reader.read(2)[:2], b'ef')
19+
assertreader.read(2)[:2]==b'ab'
20+
assertreader.read(2)[:2]==b'cd'
21+
assertreader.read(0)[:0]==b''
22+
assertreader.read(2)[:2]==b'ef'
2323

24-
def test_read2(assert_equal, assert_raises):
24+
def test_read2(assert_raises):
2525
cdef BytesIOReader reader = BytesIOReader(b'abcdef')
2626
reader.read(5)
2727
reader.read(1)
2828

29-
def test_read3(assert_equal, assert_raises):
29+
def test_read3(assert_raises):
3030
cdef BytesIOReader reader = BytesIOReader(b'abcdef')
3131
reader.read(6)
3232

33-
def test_read_eof(assert_equal, assert_raises):
33+
def test_read_eof(assert_raises):
3434
cdef BytesIOReader reader = BytesIOReader(b'abcdef')
3535
reader.read(5)
3636
# cannot convert reader.read to an object, do it manually

‎tests/unit/cython/test_bytesio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ class BytesIOTest(unittest.TestCase):
2323

2424
@cythontest
2525
def test_reading(self):
26-
bytesio_testhelper.test_read1(self.assertEqual, self.assertRaises)
27-
bytesio_testhelper.test_read2(self.assertEqual, self.assertRaises)
28-
bytesio_testhelper.test_read3(self.assertEqual, self.assertRaises)
26+
bytesio_testhelper.test_read1(self.assertRaises)
27+
bytesio_testhelper.test_read2(self.assertRaises)
28+
bytesio_testhelper.test_read3(self.assertRaises)
2929

3030
@cythontest
3131
def test_reading_error(self):
32-
bytesio_testhelper.test_read_eof(self.assertEqual, self.assertRaises)
32+
bytesio_testhelper.test_read_eof(self.assertRaises)

0 commit comments

Comments
(0)

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