Skip to content

Commit 7ef2a45

Browse files
committed
Make test_distribute_testcases stricter
1 parent 9e69b34 commit 7ef2a45

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

unittests/test_distribute_tests.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,19 @@ def test_distribute_testcases(loader, default_exec_ctx):
4646
assert count == 4
4747
count = sum(map(lambda x: x.partition.fullname == 'sys0:p1', new_cases))
4848
assert count == 2
49+
50+
def sys0p0_nodes():
51+
for nodelist in (['n2'], ['n2'], ['n1'], ['n1']):
52+
yield nodelist
53+
54+
nodelist_iter = sys0p0_nodes()
4955
for tc in new_cases:
5056
nodes = getattr(tc.check, '$nid')
5157
if tc.partition.fullname == 'sys0:p0':
52-
assert nodes in (['n1'], ['n2'])
58+
assert nodes == next(nodelist_iter)
5359
else:
5460
assert nodes == ['n3']
61+
62+
# Make sure we have consumed all the elements from nodelist_iter
63+
with pytest.raises(StopIteration):
64+
next(nodelist_iter)

0 commit comments

Comments
 (0)