Skip to content

Commit 2b9295c

Browse files
encukoupganssle
authored andcommitted
Remove the old test_call.CFunctionCalls
These tests are now covered by in TestCallingConventions (and subclasses)
1 parent d9ed649 commit 2b9295c

File tree

1 file changed

+0
-126
lines changed

1 file changed

+0
-126
lines changed

Lib/test/test_call.py

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -27,132 +27,6 @@ def fn(**kw):
2727
self.assertEqual(list(res.items()), expected)
2828

2929

30-
# The test cases here covered several paths through the function calling
31-
# code. They depended on the C function being defined with the METH_VARARGS
32-
# or METH_OLDARGS flag, but all these functions have since changed these
33-
# flags.
34-
# Nevertheless, the tests should still pass, so we keep them.
35-
36-
class CFunctionCalls(unittest.TestCase):
37-
38-
# {}.__contains__
39-
40-
def test_varargs0(self):
41-
self.assertRaises(TypeError, {}.__contains__)
42-
43-
def test_varargs1(self):
44-
{}.__contains__(0)
45-
46-
def test_varargs2(self):
47-
self.assertRaises(TypeError, {}.__contains__, 0, 1)
48-
49-
def test_varargs0_ext(self):
50-
try:
51-
{}.__contains__(*())
52-
except TypeError:
53-
pass
54-
55-
def test_varargs1_ext(self):
56-
{}.__contains__(*(0,))
57-
58-
def test_varargs2_ext(self):
59-
try:
60-
{}.__contains__(*(1, 2))
61-
except TypeError:
62-
pass
63-
else:
64-
raise RuntimeError
65-
66-
def test_varargs1_kw(self):
67-
self.assertRaises(TypeError, {}.__contains__, x=2)
68-
69-
def test_varargs2_kw(self):
70-
self.assertRaises(TypeError, {}.__contains__, x=2, y=2)
71-
72-
# {}.keys
73-
74-
def test_oldargs0_0(self):
75-
{}.keys()
76-
77-
def test_oldargs0_1(self):
78-
self.assertRaises(TypeError, {}.keys, 0)
79-
80-
def test_oldargs0_2(self):
81-
self.assertRaises(TypeError, {}.keys, 0, 1)
82-
83-
def test_oldargs0_0_ext(self):
84-
{}.keys(*())
85-
86-
def test_oldargs0_1_ext(self):
87-
try:
88-
{}.keys(*(0,))
89-
except TypeError:
90-
pass
91-
else:
92-
raise RuntimeError
93-
94-
def test_oldargs0_2_ext(self):
95-
try:
96-
{}.keys(*(1, 2))
97-
except TypeError:
98-
pass
99-
else:
100-
raise RuntimeError
101-
102-
def test_oldargs0_0_kw(self):
103-
try:
104-
{}.keys(x=2)
105-
except TypeError:
106-
pass
107-
else:
108-
raise RuntimeError
109-
110-
def test_oldargs0_1_kw(self):
111-
self.assertRaises(TypeError, {}.keys, x=2)
112-
113-
def test_oldargs0_2_kw(self):
114-
self.assertRaises(TypeError, {}.keys, x=2, y=2)
115-
116-
# [].count
117-
118-
def test_oldargs1_0(self):
119-
self.assertRaises(TypeError, [].count)
120-
121-
def test_oldargs1_1(self):
122-
[].count(1)
123-
124-
def test_oldargs1_2(self):
125-
self.assertRaises(TypeError, [].count, 1, 2)
126-
127-
def test_oldargs1_0_ext(self):
128-
try:
129-
[].count(*())
130-
except TypeError:
131-
pass
132-
else:
133-
raise RuntimeError
134-
135-
def test_oldargs1_1_ext(self):
136-
[].count(*(1,))
137-
138-
def test_oldargs1_2_ext(self):
139-
try:
140-
[].count(*(1, 2))
141-
except TypeError:
142-
pass
143-
else:
144-
raise RuntimeError
145-
146-
def test_oldargs1_0_kw(self):
147-
self.assertRaises(TypeError, [].count, x=2)
148-
149-
def test_oldargs1_1_kw(self):
150-
self.assertRaises(TypeError, [].count, {}, x=2)
151-
152-
def test_oldargs1_2_kw(self):
153-
self.assertRaises(TypeError, [].count, x=2, y=2)
154-
155-
15630
@cpython_only
15731
class CFunctionCallsErrorMessages(unittest.TestCase):
15832

0 commit comments

Comments
 (0)