File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1743,13 +1743,17 @@ def parsefactories(
17431743 # The attribute can be an arbitrary descriptor, so the attribute
17441744 # access below can raise. safe_getattr() ignores such exceptions.
17451745 obj_ub = safe_getattr (holderobj_tp , name , None )
1746- if isinstance (obj_ub , FixtureFunctionDefinition ) :
1746+ if type (obj_ub ) is FixtureFunctionDefinition :
17471747 marker = obj_ub ._fixture_function_marker
17481748 if marker .name :
17491749 name = marker .name
17501750
17511751 # OK we know it is a fixture -- now safe to look up on the _instance_.
1752- obj = getattr (holderobj_tp , name )
1752+ try :
1753+ obj = getattr (holderobj , name )
1754+ # if the fixture is named in the decorator we cannot find it in the module
1755+ except AttributeError :
1756+ obj = obj_ub
17531757
17541758 func = get_real_method (obj , holderobj )
17551759
You can’t perform that action at this time.
0 commit comments