Добро пожаловать в Stack Overflow Madhuvanthi.
Я думаю, вы должны отслеживать сбои индивидуально, а затем создавать настраиваемое сообщение подтверждения для отображения ошибок пользователю:
@then("----------------------------------")
def step_impl(context, vnf):
some_list=[] # list of values
failures = list()
for log in context:
for key, val in log.items():
for elem in some_list():
if val not in elem:
failures.append((val, elem))
# Create an assertion message detailing why the assertion failed
assert_msg = "The following values were not found in the corresponding element:\n"
for val, elem in failures:
assert_msg += "Value: {}, Element: {}\n".format(val, elem)
# This form of the assertion allows you to pass in a custom message that will be
# displayed only if the assertion is False
assert len(failures) == 0, assert_msg