Skip to content

Commit ab7baf8

Browse files
Extended test coverage for cbwr_get
1 parent 139d9d2 commit ab7baf8

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

tests/test_mkl_service.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,30 +205,33 @@ def test_cbwr(self):
205205
'sse4_2',
206206
'avx',
207207
'avx2',
208-
'avx2,strict',
209208
'avx512_mic',
210-
'avx512_mic,strict',
211209
'avx512',
212-
'avx512,strict',
213210
'avx512_mic_e1',
214211
'avx512_e1',
212+
]
213+
strict = [
214+
'avx2,strict',
215+
'avx512_mic,strict',
216+
'avx512,strict',
215217
'avx512_e1,strict',
216218
]
217219
for branch in branches:
218-
yield self.check_cbwr, branch
220+
yield self.check_cbwr, branch, 'branch'
221+
for branch in branches + strict:
222+
yield self.check_cbwr, branch, 'all'
219223

220-
def check_cbwr(self, branch):
224+
def check_cbwr(self, branch, cnr_const):
221225
status = mkl.cbwr_set(branch=branch)
222226
if status == 'success':
223227
expected_value = 'branch_off' if branch == 'off' else branch
224-
actual_value = mkl.cbwr_get(cnr_const='all')
225-
assert_equals(actual_value, expected_value, msg="Round-trip failure for CNR branch '{}'".format(branch))
228+
actual_value = mkl.cbwr_get(cnr_const=cnr_const)
229+
assert_equals(actual_value,
230+
expected_value,
231+
msg="Round-trip failure for CNR branch '{}', CNR const '{}'".format(branch, cnr_const))
226232
elif status != 'err_unsupported_branch':
227233
raise AssertionError(status)
228234

229-
def test_cbwr_get_all(self):
230-
mkl.cbwr_get(cnr_const='all')
231-
232235
def test_cbwr_get_auto_branch(self):
233236
mkl.cbwr_get_auto_branch()
234237

0 commit comments

Comments
 (0)