Skip to content

Commit ba7071b

Browse files
authored
Merge pull request #4367 from tybug/fix-pareto-listener
Fix pareto listener not firing in one case
2 parents da16804 + 7b2b032 commit ba7071b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hypothesis-python/RELEASE.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RELEASE_TYPE: patch
2+
3+
Fix a rare case where database entries were kept after they were no longer needed when using |Phase.target|.

hypothesis-python/src/hypothesis/internal/conjecture/pareto.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def add(self, data: Union[ConjectureData, ConjectureResult, _Overrun]) -> bool:
248248
i -= 1
249249

250250
for v in to_remove:
251-
self.__remove(v)
251+
self._remove(v)
252252
return data in self.front
253253
finally:
254254
self.__pending = None
@@ -272,7 +272,7 @@ def __getitem__(self, i: int) -> ConjectureResult:
272272
def __len__(self) -> int:
273273
return len(self.front)
274274

275-
def __remove(self, data: ConjectureResult) -> None:
275+
def _remove(self, data: ConjectureResult) -> None:
276276
try:
277277
self.front.remove(data)
278278
except ValueError:
@@ -337,10 +337,7 @@ def allow_transition(source, destination):
337337
# must be dominated in the front - either ``destination`` is in
338338
# the front, or it was not added to it because it was
339339
# dominated by something in it.
340-
try:
341-
self.front.front.remove(source)
342-
except ValueError:
343-
pass
340+
self.front._remove(source)
344341
return True
345342
return False
346343

0 commit comments

Comments
 (0)