8000 gh-111495: Add tests for PyList C API by rawwar · Pull Request #111562 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111495: Add tests for PyList C API #111562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d43d9b2
init test c file
rawwar Oct 31, 2023
119cd0e
single test added
rawwar Oct 31, 2023
ccf1bff
fix lint
rawwar Oct 31, 2023
8d17ca6
fix list check tests
rawwar Oct 31, 2023
bd9415d
lint
rawwar Oct 31, 2023
17d60d1
add 2 tests
rawwar Oct 31, 2023
322eab9
add test
rawwar Oct 31, 2023
5c58022
add getitem test
rawwar Oct 31, 2023
6b12f1f
test list_get_item
rawwar Oct 31, 2023
70e385f
add test for setitem
rawwar Oct 31, 2023
3166ba4
add test for setitem
rawwar Oct 31, 2023
2a50fb8
Merge branch 'kalyan/test-capi-list' of github.com:rawwar/cpython int…
rawwar Oct 31, 2023
1c30f3b
Merge branch 'main' of github.com:rawwar/cpython into kalyan/test-cap…
rawwar Nov 1, 2023
392b3c6
add tests
rawwar Nov 1, 2023
eac8c67
lint fix
rawwar Nov 1, 2023
0f40f6d
add tests
rawwar Nov 1, 2023
40e4022
Update Lib/test/test_capi/test_list.py
rawwar Nov 1, 2023
d31fa57
Update Modules/_testcapi/list.c
rawwar Nov 1, 2023
433351d
Update Lib/test/test_capi/test_list.py
rawwar Nov 1, 2023
34e915b
Update Lib/test/test_capi/test_list.py
rawwar Nov 1, 2023
0e340a1
pr feedback fixes
rawwar Nov 1, 2023
8de9cf8
fixes for the feedback
rawwar Nov 1, 2023
44dcf85
add tests from vstinner PR
rawwar Nov 1, 2023
1000126
Merge branch 'main' into kalyan/test-capi-list
rawwar Nov 1, 2023
2c6a41c
remove unused import
rawwar Nov 1, 2023
e486451
Update list.c
rawwar Nov 1, 2023
633951b
Merge branch 'main' into kalyan/test-capi-list
rawwar Nov 1, 2023
9afa50c
Merge branch 'main' into kalyan/test-capi-list
rawwar Nov 2, 2023
361b045
Merge branch 'main' into kalyan/test-capi-list
rawwar Nov 2, 2023
ca07ac9
Update Modules/_testcapi/list.c
vstinner Nov 8, 2023
dc039f1
Update Modules/_testcapi/list.c
vstinner Nov 8, 2023
5ecfa40
Merge branch 'main' into kalyan/test-capi-list
serhiy-storchaka Nov 8, 2023
42a2a54
Minor fixes.
serhiy-storchaka Nov 8, 2023
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
lint fix
Signed-off-by: kalyanr <kalyan.ben10@live.com>
  • Loading branch information
rawwar committed Nov 1, 2023
commit eac8c671e2e77a75623d55798b1c68e00fcc572f
16 changes: 7 additions & 9 deletions Lib/test/test_capi/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def test_check(self):
self.assertFalse(check((1, 2)))
self.assertFalse(check(42))
self.assertFalse(check(object()))

# CRASHES check(NULL)


def test_list_check_exact(self):
# Test PyList_CheckExact()
check = _testcapi.list_check_exact
Expand All @@ -35,7 +35,7 @@ def test_list_check_exact(self):
self.assertFalse(check(UserList([1, 2])))
self.assertFalse(check({1: 2}))
self.assertFalse(check(object()))

# CRASHES check(NULL)

def test_list_new(self):
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_list_setitem(self):
self.assertRaises(SystemError, setitem, {}, 0, 5)

# CRASHES setitem(NULL, 'a', 5)

def test_list_insert(self):
# Test PyList_Insert()
insert = _testcapi.list_insert
Expand All @@ -119,7 +119,7 @@ def test_list_append(self):
self.assertEqual(lst[-1], [4,5,6])
self.assertRaises(SystemError, append, lst, NULL)
# CRASHES append(NULL, 0)

def test_list_getslice(self):
# Test PyList_GetSlice()
getslice = _testcapi.list_getslice
Expand All @@ -130,7 +130,5 @@ def test_list_getslice(self):
self.assertEqual(getslice(lst, 6, 100), [7,8,9,10])
self.assertNotEqual(getslice(lst, -2, -1), [9])
self.assertRaises(TypeError, lst, 'a', '2')

# CRASHES getslice(NULL, 1, 2)


0