Commit bf34b958 authored by Wout De Nolf's avatar Wout De Nolf
Browse files

writer tests: clear message in pytest summary when the scan itself fails

parent cb81e1a2
......@@ -39,10 +39,24 @@ def run_scan(scan, runasync=False):
ctrl_params["saving_format"] = "EDF"
ctrl_params["saving_frame_per_file"] = 3
ctrl_params["saving_suffix"] = ".edf"
run_method = scan_run(scan.run)
if runasync:
return gevent.spawn(scan.run)
return gevent.spawn(run_method)
else:
return scan.run()
return run_method()
def scan_run(run_method):
@functools.wraps(run_method)
def wrapper(*args, **kw):
try:
return run_method(*args, **kw)
except Exception as e:
raise RuntimeError("Scan failed") from e
except gevent.Timeout as e:
raise RuntimeError("Scan did not finish in time") from e
return wrapper
def assert_async_scans_success(scans, greenlets):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment