Skip to content

Commit 9fad01d

Browse files
committedMar 4, 2015
test/thorlabs_tcube: fix test discovery and style
1 parent c2831db commit 9fad01d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

Diff for: ‎artiq/test/thorlabs_tcube.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
from artiq.devices.thorlabs_tcube.driver import Tdc, Tpz, TdcSim, TpzSim
66
from artiq.language.units import V
77

8+
89
no_hardware = bool(os.getenv("ARTIQ_NO_HARDWARE"))
910

1011

11-
class GenericTdcTest(unittest.TestCase):
12+
class GenericTdcTest:
1213
def test_pot_parameters(self):
1314
test_vector = 1, 2, 3, 4, 5, 6, 7, 8
1415
self.cont.set_pot_parameters(*test_vector)
@@ -82,14 +83,13 @@ def test_button_parameters(self):
8283
self.assertEqual(test_vector, self.cont.get_button_parameters())
8384

8485

85-
class GenericTpzTest(unittest.TestCase):
86+
class GenericTpzTest:
8687
def test_position_control_mode(self):
8788
test_vector = 1
8889
self.cont.set_position_control_mode(test_vector)
8990
self.assertEqual(test_vector, self.cont.get_position_control_mode())
9091

9192
def test_ouput_volts(self):
92-
9393
for voltage in 5*V, 10*V, 15*V, \
9494
round(self.cont.get_tpz_io_settings()[0].amount)*V:
9595
with self.subTest(voltage=voltage):
@@ -135,7 +135,7 @@ def test_tpz_io_settings(self):
135135

136136

137137
@unittest.skipIf(no_hardware, "no hardware")
138-
class TestTdc(GenericTdcTest):
138+
class TestTdc(unittest.TestCase, GenericTdcTest):
139139
def setUp(self):
140140
serial = os.getenv("ARTIQ_TDC001_SERIAL")
141141
args = dict()
@@ -144,13 +144,13 @@ def setUp(self):
144144
self.cont = Tdc(**args)
145145

146146

147-
class TestTdcSim(GenericTdcTest):
147+
class TestTdcSim(unittest.TestCase, GenericTdcTest):
148148
def setUp(self):
149149
self.cont = TdcSim()
150150

151151

152152
@unittest.skipIf(no_hardware, "no hardware")
153-
class TestTpz(GenericTpzTest):
153+
class TestTpz(unittest.TestCase, GenericTpzTest):
154154
def setUp(self):
155155
serial = os.getenv("ARTIQ_TPZ001_SERIAL")
156156
args = dict()
@@ -159,6 +159,6 @@ def setUp(self):
159159
self.cont = Tpz(**args)
160160

161161

162-
class TestTpzSim(GenericTpzTest):
162+
class TestTpzSim(unittest.TestCase, GenericTpzTest):
163163
def setUp(self):
164164
self.cont = TpzSim()

0 commit comments

Comments
 (0)
Please sign in to comment.