test_watchdog_on_scan_data_with_exception: Should not be called
A "should not be called" exception is raised from test_watchdog_on_scan_data_with_exception
It means that it can be called.
There is maybe fixes to do at some places?
https://gitlab.esrf.fr/bliss/bliss/-/jobs/926709
__________________ test_watchdog_on_scan_data_with_exception ___________________
session = <bliss.common.session.Session object at 0x7f63af0eb4c0>
def test_watchdog_on_scan_data_with_exception(session):
s = scans.timescan(0.1, run=False, save=False)
class Watchdog(scan.WatchdogCallback):
def __init__(self):
super().__init__()
def on_timeout(self):
raise RuntimeError("Should not be called")
def on_scan_data(self, data_events, scan_info):
raise ValueError("Bang!!!")
s.set_watchdog_callback(Watchdog())
with pytest.raises(ValueError):
with gevent.Timeout(3):
> s.run()
tests/scans/test_watchdog.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:1287: in run
self._execute_scan_runner(runner)
/opt/conda/envs/default_env/lib/python3.9/contextlib.py:532: in __exit__
raise exc_details[1]
/opt/conda/envs/default_env/lib/python3.9/contextlib.py:517: in __exit__
if cb(*exc_details):
/opt/conda/envs/default_env/lib/python3.9/contextlib.py:126: in __exit__
next(self.gen)
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/common/cleanup.py:290: in capture_exceptions
raise value
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/common/cleanup.py:266: in capture
yield
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:1372: in wrapper
yield
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:1287: in run
self._execute_scan_runner(runner)
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:1359: in _execute_scan_runner
runner.send(
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:332: in send
return self.runner.send(arg)
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:390: in _run
self._gwait(stop_tasks, masked_kill_nb=1)
/opt/conda/envs/default_env/lib/python3.9/contextlib.py:126: in __exit__
next(self.gen)
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/common/cleanup.py:290: in capture_exceptions
raise value
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/common/cleanup.py:266: in capture
yield
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:365: in _run
t.get() # get the task result ; this may raise an exception
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/common/greenlet_utils/killmask.py:197: in get
return super().get(*args, **keys)
src/gevent/greenlet.py:805: in gevent._gevent_cgreenlet.Greenlet.get
???
src/gevent/greenlet.py:373: in gevent._gevent_cgreenlet.Greenlet._raise_exception
???
/opt/conda/envs/default_env/lib/python3.9/site-packages/gevent/_compat.py:49: in reraise
raise value.with_traceback(tb)
src/gevent/greenlet.py:908: in gevent._gevent_cgreenlet.Greenlet.run
???
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:167: in _run
raise ev
/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/scan.py:204: in loop
self._callback.on_timeout()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> raise RuntimeError("Should not be called")
E RuntimeError: Should not be called
tests/scans/test_watchdog.py:87: RuntimeError