File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,16 @@ def decorator(func):
79
79
old_sig = inspect .signature (func )
80
80
81
81
@pytest .mark .parametrize ("ext" , extensions )
82
- def wrapper (* args , ext , request , ** kwargs ):
82
+ def wrapper (* args , ext = "png" , request = None , ** kwargs ):
83
83
if "ext" in old_sig .parameters :
84
84
kwargs ["ext" ] = ext
85
85
if "request" in old_sig .parameters :
86
86
kwargs ["request" ] = request
87
-
88
- file_name = "" .join (c for c in request .node .name if c in ALLOWED_CHARS )
87
+ try :
88
+ file_name = "" .join (c for c in request .node .name if c in ALLOWED_CHARS )
89
+ except AttributeError : # 'NoneType' object has no attribute 'node'
90
+ raise
91
+ file_name = func .__name__
89
92
try :
90
93
fig_ref , fig_test = func (* args , ** kwargs )
91
94
ref_image_path = os .path .join (result_dir , f"{ file_name } -expected.{ ext } " )
You can’t perform that action at this time.
0 commit comments