File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -155,9 +155,12 @@ def test_function_positional_args(name):
155
155
# Duplicate the last positional argument for the n+1 test.
156
156
args = args + [args [- 1 ]]
157
157
158
+ kwonlydefaults = argspec .kwonlydefaults or {}
159
+ required_kwargs = {arg : example_argument (arg , name , dtype ) for arg in argspec .kwonlyargs if arg not in kwonlydefaults }
160
+
158
161
for n in range (nargs [0 ]+ 2 ):
159
162
if n in nargs :
160
- doesnt_raise (lambda : mod_func (* args [:n ]))
163
+ doesnt_raise (lambda : mod_func (* args [:n ], ** required_kwargs ))
161
164
elif argspec .varargs :
162
165
pass
163
166
else :
@@ -183,7 +186,7 @@ def test_function_keyword_only_args(name):
183
186
if name .startswith ('__' ):
184
187
args = args [1 :]
185
188
kwonlyargs = argspec .kwonlyargs
186
- kwonlydefaults = argspec .kwonlydefaults
189
+ kwonlydefaults = argspec .kwonlydefaults or {}
187
190
dtype = None
188
191
189
192
args = [example_argument (arg , name , dtype ) for arg in args ]
You can’t perform that action at this time.
0 commit comments