@@ -211,16 +211,16 @@ def foo(bar):
211
211
p2 .new_attr = 'spam'
212
212
self .assertEqual (p2 .new_attr , 'spam' )
213
213
214
- # def test_placeholders_trailing_trim (self):
215
- # PH = self.module.Placeholder
216
- # for args, call_args, expected_args in [
217
- # [(PH,), (), ()],
218
- # [(0, PH), (), (0,)],
219
- # [(0, PH, 1 , PH, PH, PH ), (2, ), (0, 2, 1 )]
220
- # ]:
221
- # actual_args, actual_kwds = self.partial(capture, *args)(*call_args)
222
- # self.assertEqual(actual_args, expected_args)
223
- # self.assertEqual(actual_kwds, {})
214
+ def test_trailing_placeholders (self ):
215
+ PH = self .module .Placeholder
216
+ for args , call_args , expected_args in [
217
+ [(PH ,), (1 , ), (1 , )],
218
+ [(0 , PH ), (1 , ), (0 , 1 )],
219
+ [(0 , PH , 2 , PH , PH ), (1 , 3 , 4 ), (0 , 1 , 2 , 3 , 4 )]
220
+ ]:
221
+ actual_args , actual_kwds = self .partial (capture , * args )(* call_args )
222
+ self .assertEqual (actual_args , expected_args )
223
+ self .assertEqual (actual_kwds , {})
224
224
225
225
def test_placeholders (self ):
226
226
PH = self .module .Placeholder
@@ -373,12 +373,6 @@ def test_setstate(self):
373
373
f ()
374
374
self .assertEqual (f (2 ), ((2 , 1 ), dict (a = 10 )))
375
375
376
- # # Trailing Placeholder error
377
- # f = self.partial(signature)
378
- # msg_regex = re.escape("unexpected trailing Placeholders")
379
- # with self.assertRaisesRegex(TypeError, f'^{msg_regex}$') as cm:
380
- # f.__setstate__((capture, (1, PH), dict(a=10), dict(attr=[])))
381
-
382
376
def test_setstate_errors (self ):
383
377
f = self .partial (signature )
384
378
self .assertRaises (TypeError , f .__setstate__ , (capture , (), {}))
0 commit comments