Skip to content

Commit aa46aa0

Browse files
DiegoBaldassarMilleunofilmor
authored andcommitted
Added missing type conversions in mixin tests
Also made sequence __deitem__ test not rely on negative indexes
1 parent cf75171 commit aa46aa0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/test_collection_mixins_sequence.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def test_setitem_raise(self):
129129
def test_delitem(self):
130130
arr = self.get_copy()
131131
exp_lst = list(arr)[:-1]
132-
del arr[-1]
132+
del arr[len(arr) - 1]
133133
assert list(arr) == exp_lst
134134

135135
@pytest.mark.xfail(reason='Known to crash', run=False)
@@ -143,16 +143,16 @@ def test_delitem_raise(self):
143143
def test_insert(self):
144144
arr = self.get_copy()
145145
length = len(arr)
146-
arr.insert(1, 333)
146+
arr.insert(1, self.vtype(333))
147147
assert len(arr) == length + 1
148-
assert arr[1] == 333
148+
assert arr[1] == self.vtype(333)
149149

150150
def test_append(self):
151151
arr = self.get_copy()
152152
orig_length = len(arr)
153-
arr.append(444)
153+
arr.append(self.vtype(444))
154154
assert len(arr) == orig_length + 1
155-
assert arr[orig_length] == 444
155+
assert arr[orig_length] == self.vtype(444)
156156

157157
@pytest.mark.xfail(reason='Known to crash', run=False)
158158
def test_pop(self):
@@ -200,7 +200,7 @@ def test_remove_raise(self):
200200
def test_iadd(self):
201201
arr = self.get_copy()
202202
orig_length = len(arr)
203-
arr += [777, 888]
203+
arr += [self.vtype(777), self.vtype(888)]
204204
assert exactly_equal(arr[orig_length ], self.vtype(777))
205205
assert exactly_equal(arr[orig_length + 1], self.vtype(888))
206206
assert len(arr) == orig_length + 2

0 commit comments

Comments
 (0)