From a7b0976c3e183397a648598d96a7e1fa965cbd90 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 15 Oct 2011 13:43:21 -0400 Subject: PyEval_CallObject requires a tuple of args (closes #13186) --- Lib/test/test_class.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Lib/test/test_class.py') diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index 0f25101827..db75b93479 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -350,6 +350,19 @@ class ClassTests(unittest.TestCase): AllTests.__delslice__ = delslice + @test_support.cpython_only + def testDelItem(self): + class A: + ok = False + def __delitem__(self, key): + self.ok = True + a = A() + # Subtle: we need to call PySequence_SetItem, not PyMapping_SetItem. + from _testcapi import sequence_delitem + sequence_delitem(a, 2) + self.assertTrue(a.ok) + + def testUnaryOps(self): testme = AllTests() -- cgit v1.2.1