File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -525,10 +525,16 @@ def __call__(self, test_state):
525
525
kwargs = dict (self .extra_kwargs )
526
526
kwargs .update (test_state .plug_manager .provide_plugs (
527
527
(plug .name , plug .cls ) for plug in self .plugs if plug .update_kwargs ))
528
- arg_info = inspect .getargspec (self .func )
528
+
529
+ if sys .version_info [0 ] < 3 :
530
+ arg_info = inspect .getargspec (self .func )
531
+ keywords = arg_info .keywords
532
+ else :
533
+ arg_info = inspect .getfullargspec (self .func )
534
+ keywords = arg_info .varkw
529
535
# Pass in test_api if the phase takes *args, or **kwargs with at least 1
530
536
# positional, or more positional args than we have keyword args.
531
- if arg_info .varargs or (arg_info . keywords and len (arg_info .args ) >= 1 ) or (
537
+ if arg_info .varargs or (keywords and len (arg_info .args ) >= 1 ) or (
532
538
len (arg_info .args ) > len (kwargs )):
533
539
# Underlying function has room for test_api as an arg. If it doesn't
534
540
# expect it but we miscounted args, we'll get another error farther down.
You can’t perform that action at this time.
0 commit comments