Here is add_result
function. The testrail
plugin executes it when your test (test_run) is finished.
You can notice the parameter status
in the function, it requires your test need to return the result from assertion (ex. assert False is good example).
In your case, just print a string is not good to testrail
know the status of the test.
def add_result(self, test_ids, status, comment='', duration=0):
"""
Add a new result to results dict to be submitted at the end.
:param list test_ids: list of test_ids.
:param int status: status code of test (pass or fail).
:param comment: None or a failure representation.
:param duration: Time it took to run just the test.
"""