Add condition to equals of TestCaseChromosome that compares their executiontrace, if available.
@@ -283,6 +283,14 @@ class TestCaseChromosome(chrom.Chromosome):
return True
if not isinstance(other, TestCaseChromosome):
return False
+ # This condition is playing with fire, but it is required to not lose coverage
+ # information on flaky tests. For more information on this see #169.
+ # Be careful when comparing TestCaseChromosomes!
+ if (left := self._last_execution_result) is not None and (
+ right := other._last_execution_result
+ ) is not None:
+ if left.execution_trace != right.execution_trace:
+ return False
return self._test_case == other._test_case
def __hash__(self):
