File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -766,8 +766,9 @@ def run(self, **kwargs):
766
766
'name' : 'command-failed' ,
767
767
'error' : str (e )
768
768
})
769
- self .add_warning (str (e ))
770
- break
769
+ raise RuntimeError (
770
+ 'Command #{0} failed (\" {1}\" ").\n Error: \" {2}\" ' .format (
771
+ i , command .description , str (e ))) from e
771
772
772
773
return self ._runtime_warnings
773
774
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def test_stop_run(self):
62
62
63
63
def _run ():
64
64
nonlocal res
65
- res = self .robot .run ( )
65
+ self .assertRaises ( RuntimeError ( self . robot .run ) )
66
66
67
67
thread = threading .Thread (target = _run )
68
68
thread .start ()
@@ -71,8 +71,17 @@ def _run():
71
71
72
72
thread .join ()
73
73
74
- self .assertEquals (
75
- res [- 1 ], 'Received a STOP signal and exited from movements' )
74
+ def test_exceptions_during_run (self ):
75
+ p200 = instruments .Pipette (axis = 'b' , name = 'my-fancy-pancy-pipette' )
76
+
77
+ def _do ():
78
+ return 'hello' / 3
79
+
80
+ p200 .create_command (
81
+ do = _do ,
82
+ enqueue = True )
83
+
84
+ self .assertRaises (RuntimeError , self .robot .run )
76
85
77
86
def test_calibrated_max_dimension (self ):
78
87
You can’t perform that action at this time.
0 commit comments