Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added missing type conversions in mixin tests
Also made sequence __deitem__ test not rely on negative indexes
  • Loading branch information
DiegoBaldassarMilleuno committed Jan 10, 2025
commit 4f821cea5d61134cc252c433941c5d2bf4f02067
12 changes: 6 additions & 6 deletions tests/test_collection_mixins_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_setitem_raise(self):
def test_delitem(self):
arr = self.get_copy()
exp_lst = list(arr)[:-1]
del arr[-1]
del arr[len(arr) - 1]
assert list(arr) == exp_lst

@pytest.mark.xfail(reason='Known to crash', run=False)
Expand All @@ -143,16 +143,16 @@ def test_delitem_raise(self):
def test_insert(self):
arr = self.get_copy()
length = len(arr)
arr.insert(1, 333)
arr.insert(1, self.vtype(333))
assert len(arr) == length + 1
assert arr[1] == 333
assert arr[1] == self.vtype(333)

def test_append(self):
arr = self.get_copy()
orig_length = len(arr)
arr.append(444)
arr.append(self.vtype(444))
assert len(arr) == orig_length + 1
assert arr[orig_length] == 444
assert arr[orig_length] == self.vtype(444)

@pytest.mark.xfail(reason='Known to crash', run=False)
def test_pop(self):
Expand Down Expand Up @@ -200,7 +200,7 @@ def test_remove_raise(self):
def test_iadd(self):
arr = self.get_copy()
orig_length = len(arr)
arr += [777, 888]
arr += [self.vtype(777), self.vtype(888)]
assert exactly_equal(arr[orig_length ], self.vtype(777))
assert exactly_equal(arr[orig_length + 1], self.vtype(888))
assert len(arr) == orig_length + 2
Expand Down