@@ -152,3 +152,22 @@ def test_negative_freethreading(self, modname, minor, build):
152152 msg = "only compatible with free-threaded CPython"
153153 with self .assertRaisesRegex (ImportError , msg ):
154154 _testcapi .pyabiinfo_check (modname , 1 , minor , ft_flag , build , 0 )
155+
156+
157+ class TestModsupport (unittest .TestCase ):
158+ def test_pyarg_parsevector (self ):
159+ func = _testcapi .pyarg_parsevector
160+ self .assertEqual (func (1 , 2 ), (1 , 2 , 0 ))
161+ self .assertEqual (func (1 , 2 , 3 ), (1 , 2 , 3 ))
162+ self .assertRaises (TypeError , func , 1 )
163+ self .assertRaises (TypeError , func , "str" , 2 )
164+
165+ def test_funcandkeywords (self ):
166+ func = _testcapi .pyarg_parsevectorandkeywords
167+ self .assertEqual (func (1 , 2 ), (1 , 2 , 0 ))
168+ self .assertEqual (func (1 , 2 , 3 ), (1 , 2 , 3 ))
169+ self .assertEqual (func (1 , b = 2 ), (1 , 2 , 0 ))
170+ self .assertEqual (func (1 , b = 2 , c = 3 ), (1 , 2 , 3 ))
171+ self .assertRaises (TypeError , func , 1 )
172+ self .assertRaises (TypeError , func , "str" , 2 )
173+ self .assertRaises (TypeError , func , 1 , z = 2 )
0 commit comments