test/hardware_testbench: properly close devices

This commit is contained in:
Sebastien Bourdeauducq 2016-02-23 16:00:53 +08:00
parent 5d41113dbc
commit 53d5a458a2
1 changed files with 3 additions and 2 deletions

View File

@ -97,6 +97,9 @@ class ExperimentCase(unittest.TestCase):
self.device_db, virtual_devices={"scheduler": DummyScheduler()}) self.device_db, virtual_devices={"scheduler": DummyScheduler()})
self.dataset_mgr = DatasetManager(self.dataset_db) self.dataset_mgr = DatasetManager(self.dataset_db)
def tearDown(self):
self.device_mgr.close_devices()
def create(self, cls, **kwargs): def create(self, cls, **kwargs):
try: try:
exp = cls(self.device_mgr, self.dataset_mgr, **kwargs) exp = cls(self.device_mgr, self.dataset_mgr, **kwargs)
@ -121,5 +124,3 @@ class ExperimentCase(unittest.TestCase):
except CompileError as error: except CompileError as error:
# Reduce amount of text on terminal. # Reduce amount of text on terminal.
raise error from None raise error from None
finally:
self.device_mgr.close_devices()