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

Skip to content
Merged
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
Next Next commit
Remove test_tuple_fromarray
  • Loading branch information
efimov-mikhail committed Oct 28, 2025
commit bbe2b5c3beb97d7871a7aa8717803edd49a90997
28 changes: 0 additions & 28 deletions Lib/test/test_capi/test_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,6 @@ def test_tuple_new(self):
self.assertRaises(SystemError, tuple_new, PY_SSIZE_T_MIN)
self.assertRaises(MemoryError, tuple_new, PY_SSIZE_T_MAX)

def test_tuple_fromarray(self):
# Test PyTuple_FromArray()
tuple_fromarray = _testcapi.tuple_fromarray

tup = tuple([i] for i in range(5))
copy = tuple_fromarray(tup)
self.assertEqual(copy, tup)
self._tracked(copy)

tup = tuple(42**i for i in range(5))
copy = tuple_fromarray(tup)
self.assertEqual(copy, tup)
self._not_tracked(copy)

tup = ()
copy = tuple_fromarray(tup)
self.assertIs(copy, tup)

copy = tuple_fromarray(NULL, 0)
self.assertIs(copy, ())

with self.assertRaises(SystemError):
tuple_fromarray(NULL, -1)
with self.assertRaises(SystemError):
tuple_fromarray(NULL, PY_SSIZE_T_MIN)
with self.assertRaises(MemoryError):
tuple_fromarray(NULL, PY_SSIZE_T_MAX)

def test_tuple_pack(self):
# Test PyTuple_Pack()
pack = _testlimitedcapi.tuple_pack
Expand Down
Loading