Skip to content

Commit 103f56b

Browse files
committed
TST: use server test fixture correctly
1 parent 51a1b52 commit 103f56b

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed

test/test_psp.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ def setup_pv(pvname, connect=True):
2020
return pv
2121

2222

23-
def test_server_start(server):
24-
pass
25-
26-
2723
@pytest.mark.timeout(10)
2824
@pytest.mark.parametrize('pvname', test_pvs)
29-
def test_connect_and_disconnect(pvname):
25+
def test_connect_and_disconnect(server, pvname):
3026
logger.debug('test_create_and_clear_channel %s', pvname)
3127
pv = setup_pv(pvname)
3228
assert pv.isconnected
@@ -35,7 +31,7 @@ def test_connect_and_disconnect(pvname):
3531

3632
@pytest.mark.timeout(10)
3733
@pytest.mark.parametrize('pvname', test_pvs)
38-
def test_get(pvname):
34+
def test_get(server, pvname):
3935
logger.debug('test_get_data %s', pvname)
4036
pv = setup_pv(pvname)
4137
value = pv.get()
@@ -45,7 +41,7 @@ def test_get(pvname):
4541

4642
@pytest.mark.timeout(10)
4743
@pytest.mark.parametrize('pvname', test_pvs)
48-
def test_put_get(pvname):
44+
def test_put_get(server, pvname):
4945
logger.debug('test_put_get %s', pvname)
5046
pv = setup_pv(pvname)
5147
old_value = pv.get()
@@ -65,7 +61,7 @@ def test_put_get(pvname):
6561

6662
@pytest.mark.timeout(10)
6763
@pytest.mark.parametrize('pvname', test_pvs)
68-
def test_monitor(pvname):
64+
def test_monitor(server, pvname):
6965
logger.debug('test_subscribe %s', pvname)
7066
pv = setup_pv(pvname)
7167
old_value = pv.get()
@@ -90,7 +86,7 @@ def test_monitor(pvname):
9086

9187
@pytest.mark.timeout(10)
9288
@pytest.mark.parametrize('pvname', test_pvs)
93-
def test_misc(pvname):
89+
def test_misc(server, pvname):
9490
logger.debug('test_misc %s', pvname)
9591
pv = setup_pv(pvname)
9692
assert isinstance(pv.host(), str)
@@ -102,7 +98,7 @@ def test_misc(pvname):
10298

10399

104100
@pytest.mark.timeout(10)
105-
def test_waveform():
101+
def test_waveform(server):
106102
logger.debug('test_waveform')
107103
pv = setup_pv(pvbase + ":WAVE")
108104
# Do as a tuple
@@ -119,7 +115,7 @@ def test_waveform():
119115

120116

121117
@pytest.mark.timeout(10)
122-
def test_threads():
118+
def test_threads(server):
123119
logger.debug('test_threads')
124120

125121
def some_thread_thing(pvname):

test/test_pyca.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,9 @@ def setup_pv(pvname, connect=True):
8787
return pv
8888

8989

90-
def test_server_start(server):
91-
pass
92-
93-
9490
@pytest.mark.timeout(10)
9591
@pytest.mark.parametrize('pvname', test_pvs)
96-
def test_create_and_clear_channel(pvname):
92+
def test_create_and_clear_channel(server, pvname):
9793
logger.debug('test_create_and_clear_channel %s', pvname)
9894
pv = setup_pv(pvname)
9995
assert pv.connect_cb.connected
@@ -106,7 +102,7 @@ def test_create_and_clear_channel(pvname):
106102

107103
@pytest.mark.timeout(10)
108104
@pytest.mark.parametrize('pvname', test_pvs)
109-
def test_get_data(pvname):
105+
def test_get_data(server, pvname):
110106
logger.debug('test_get_data %s', pvname)
111107
pv = setup_pv(pvname)
112108
# get time vars
@@ -129,7 +125,7 @@ def test_get_data(pvname):
129125

130126
@pytest.mark.timeout(10)
131127
@pytest.mark.parametrize('pvname', test_pvs)
132-
def test_put_get(pvname):
128+
def test_put_get(server, pvname):
133129
logger.debug('test_put_get %s', pvname)
134130
pv = setup_pv(pvname)
135131
pv.get_data(False, -1.0)
@@ -157,7 +153,7 @@ def test_put_get(pvname):
157153

158154
@pytest.mark.timeout(10)
159155
@pytest.mark.parametrize('pvname', test_pvs)
160-
def test_subscribe(pvname):
156+
def test_subscribe(server, pvname):
161157
logger.debug('test_subscribe %s', pvname)
162158
pv = setup_pv(pvname)
163159
ev = threading.Event()
@@ -193,7 +189,7 @@ def mon_cb(exception=None):
193189

194190
@pytest.mark.timeout(10)
195191
@pytest.mark.parametrize('pvname', test_pvs)
196-
def test_misc(pvname):
192+
def test_misc(server, pvname):
197193
logger.debug('test_misc %s', pvname)
198194
pv = setup_pv(pvname)
199195
assert isinstance(pv.host(), str)
@@ -205,7 +201,7 @@ def test_misc(pvname):
205201

206202

207203
@pytest.mark.timeout(10)
208-
def test_waveform():
204+
def test_waveform(server):
209205
logger.debug('test_waveform')
210206
pv = setup_pv(pvbase + ":WAVE")
211207
# Do as a tuple
@@ -229,7 +225,7 @@ def test_waveform():
229225

230226

231227
@pytest.mark.timeout(10)
232-
def test_threads():
228+
def test_threads(server):
233229
logger.debug('test_threads')
234230

235231
def some_thread_thing(pvname):

0 commit comments

Comments
 (0)