Skip to content

Commit

Permalink
test/worker: test exception logging
Browse files Browse the repository at this point in the history
sbourdeauducq committed Mar 2, 2016
1 parent 763a4d3 commit f5dee45
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions artiq/test/test_worker.py
Original file line number Diff line number Diff line change
@@ -87,8 +87,12 @@ def test_simple_run(self):
_run_experiment("SimpleExperiment")

def test_exception(self):
with self.assertRaises(WorkerInternalException):
_run_experiment("ExceptionTermination")
with self.assertLogs() as logs:
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):
_run_experiment("WatchdogNoTimeout")

0 comments on commit f5dee45

Please sign in to comment.