diff --git a/tests/functional/testplan/testing/multitest/test_multitest_parts.py b/tests/functional/testplan/testing/multitest/test_multitest_parts.py index e13e7c24c..933c07237 100644 --- a/tests/functional/testplan/testing/multitest/test_multitest_parts.py +++ b/tests/functional/testplan/testing/multitest/test_multitest_parts.py @@ -1,3 +1,4 @@ +import re from itertools import chain, cycle, repeat from operator import eq @@ -159,7 +160,7 @@ def test_multi_parts_incorrect_schedule(): ) -def test_multi_parts_duplicate_part(): +def test_multi_parts_duplicate_part(mocker): """ Execute MultiTest parts with a part of MultiTest has been scheduled twice and automatically be filtered out. @@ -167,6 +168,7 @@ def test_multi_parts_duplicate_part(): since multi_part_uid has no functional effect now, original test is invalid preserved for simple backward compatibility test, i.e. no exception raised """ + mock_warn = mocker.patch("warnings.warn") plan = TestplanMock(name="plan", merge_scheduled_parts=True) pool = ThreadPool(name="MyThreadPool", size=2) plan.add_resource(pool) @@ -179,6 +181,8 @@ def test_multi_parts_duplicate_part(): task = Task(target=get_mtest_with_custom_uid(part_tuple=(1, 3))) plan.schedule(task, resource="MyThreadPool") + assert mock_warn.call_count == 4 + assert re.search(r"remove.*multi_part_uid", mock_warn.call_args[0][0]) assert len(plan._tests) == 3 assert plan.run().run is True