File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
graalpython/com.oracle.graal.python.test/src/tests Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -176,15 +176,18 @@ def fun():
176
176
imported_test_module = None
177
177
178
178
def get_pass_name (funcname , classname ):
179
+ # try hard to get a most specific pattern
179
180
if imported_test_module :
180
181
classname = "" .join (classname .rpartition (testmod )[1 :])
181
182
clazz = imported_test_module
182
183
path_to_class = classname .split ("." )[1 :]
183
184
for part in path_to_class :
184
- clazz = getattr (clazz , part )
185
- return getattr (clazz , funcname ).__qualname__
186
- else :
187
- return funcname
185
+ clazz = getattr (clazz , part , None )
186
+ if clazz :
187
+ func = getattr (clazz , funcname , None )
188
+ if func :
189
+ return func .__qualname__
190
+ return funcname
188
191
189
192
# n.b.: we add a '*' in the front, so that unittests doesn't add
190
193
# its own asterisks, because now this is already a pattern
You can’t perform that action at this time.
0 commit comments