File tree Expand file tree Collapse file tree
devito/finite_differences Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,6 +287,21 @@ def pytest_runtest_makereport(item, call):
287287 result .outcome = 'passed'
288288
289289
290+ def pytest_make_parametrize_id (config , val , argname ):
291+ """
292+ Prevents pytest to make obsucre parameter names (param0, param1, ...)
293+ and default to str(val) instead for better log readability.
294+ """
295+ # First see if it has a name
296+ if hasattr (val , '__name__' ):
297+ return val .__name__
298+ # Then try str(val)
299+ try :
300+ return str (val )
301+ except Exception :
302+ return None # Fall back to default behavior
303+
304+
290305# A list of optimization options/pipelines to be used in testing
291306# regarding spatial and/or temporal blocking.
292307opts_tiling = ['advanced' ,
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ def _validate_expr(expr):
166166 expr = diffify (expr )
167167 except Exception as e :
168168 d = type (expr )
169- raise ValueError (f"`expr` must be a `Differentiable` type object not { d } " ) from e
169+ raise ValueError (f"`expr` must be a `Differentiable` not { d } " ) from e
170170 return expr
171171
172172 @staticmethod
You can’t perform that action at this time.
0 commit comments