Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow tests to be logged multiple times with pytest-xdist #1193
Note that this is not related to #927
In pytest-rerunfailures the test protocol is run multiple times in the event of a failure. An enhancement will log each iteration of the test with an outcome of 'rerun' until the maximum number of reruns is reached, at which point the genuine outcome is preserved. This works fine unless running the tests without pytest-xdist, which causes issues when the first rerun of a test is attempted to be removed from the scheduler:
For now I can avoid logging multiple reports if we're running tests in parallel, but that does mean that the only indication of multiple tests running will be the multiple logstart calls. Ideally there should be no difference between running tests in serial or parallel.
Hmmm I'm not sure how to implement that other than making xdist explicitly know about "reruns".
def slave_testreport(self, node, rep): if rep.when == "call" or (rep.when == "setup" and not rep.passed): self.sched.remove_item(node, rep.item_index, rep.duration)
xdist assumes that a
I'm not sure how to solve this without adding new hooks to
Another idea would be to grow a new attribute into the report object, something like
IMHO though I don't see a problem with