@@ -504,7 +504,11 @@ def get_pytest_params(item):
504
504
if is_lazy_value_or_tupleitem_with_int_base (param_value ):
505
505
# remove the int base so that pandas does not interprete it as an int.
506
506
param_value = param_value .clone (remove_int_base = True )
507
- if item .session ._fixturemanager .getfixturedefs (param_name , item .nodeid ) is not None :
507
+ if hasattr (pytest , "version_tuple" ) and pytest .version_tuple >= (8 , 1 ):
508
+ fixturedefs = item .session ._fixturemanager .getfixturedefs (param_name , item )
509
+ else :
510
+ fixturedefs = item .session ._fixturemanager .getfixturedefs (param_name , item .nodeid )
511
+ if fixturedefs is not None :
508
512
# Fixture parameters have the same name than the fixtures themselves! change it
509
513
param_dct [param_name + '_param' ] = param_value
510
514
else :
@@ -530,7 +534,11 @@ def get_pytest_fixture_names(item):
530
534
for param_name in item .fixturenames : # note: item.funcargnames gives the exact same list
531
535
# if hasattr(item, 'callspec'): # NO! it would only return fixtures when they are parametrized
532
536
# if param_name in item.callspec.params: NO ! it would only return fixtures when they are *directly* parametrized
533
- if item .session ._fixturemanager .getfixturedefs (param_name , item .nodeid ) is not None :
537
+ if hasattr (pytest , "version_tuple" ) and pytest .version_tuple >= (8 , 1 ):
538
+ fixturedefs = item .session ._fixturemanager .getfixturedefs (param_name , item )
539
+ else :
540
+ fixturedefs = item .session ._fixturemanager .getfixturedefs (param_name , item .nodeid )
541
+ if fixturedefs is not None :
534
542
fixture_names .append (param_name )
535
543
536
544
return fixture_names
0 commit comments