I have some unstable tests and use rerunfailures plugin for this tests. If test failed it would be rerun.
Example of pytest result for this test:
== 1 passed, 2 rerun in 225.75 seconds ==
But this test will be marked as failed in testrail. Is any way to mark this test as passed?