Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
bf34b958
Commit
bf34b958
authored
Jun 03, 2021
by
Wout De Nolf
Browse files
writer tests: clear message in pytest summary when the scan itself fails
parent
cb81e1a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/nexus_writer/helpers/nxw_test_utils.py
View file @
bf34b958
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment