forked from M-Labs/artiq
test/worker: test exception logging
This commit is contained in:
parent
763a4d3011
commit
f5dee455f5
|
@ -87,8 +87,12 @@ class WorkerCase(unittest.TestCase):
|
||||||
_run_experiment("SimpleExperiment")
|
_run_experiment("SimpleExperiment")
|
||||||
|
|
||||||
def test_exception(self):
|
def test_exception(self):
|
||||||
with self.assertRaises(WorkerInternalException):
|
with self.assertLogs() as logs:
|
||||||
_run_experiment("ExceptionTermination")
|
with self.assertRaises(WorkerInternalException):
|
||||||
|
_run_experiment("ExceptionTermination")
|
||||||
|
self.assertEqual(len(logs.records), 1)
|
||||||
|
self.assertIn("Terminating with exception (TypeError)",
|
||||||
|
logs.output[0])
|
||||||
|
|
||||||
def test_watchdog_no_timeout(self):
|
def test_watchdog_no_timeout(self):
|
||||||
_run_experiment("WatchdogNoTimeout")
|
_run_experiment("WatchdogNoTimeout")
|
||||||
|
|
Loading…
Reference in New Issue