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):
7979 old_sig = inspect .signature (func )
8080
8181 @pytest .mark .parametrize ("ext" , extensions )
82- def wrapper (* args , ext , request , ** kwargs ):
82+ def wrapper (* args , ext = "png" , request = None , ** kwargs ):
8383 if "ext" in old_sig .parameters :
8484 kwargs ["ext" ] = ext
8585 if "request" in old_sig .parameters :
8686 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__
8992 try :
9093 fig_ref , fig_test = func (* args , ** kwargs )
9194 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