diff --git a/CHANGELOG.md b/CHANGELOG.md index e96f8791affe91c6fa20107c8e76d7866487f8db..b8a8d96a8c6f5586e209b0dbc3020da0b28eb8c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ # v2.24.1 -* minor pylint improvements \ No newline at end of file +* minor pylint improvements +* better coverage +* SyncableDroppable.cleanup() bugs out, wrote a quick patch for it to do nothing and filed as #61. diff --git a/satella/__init__.py b/satella/__init__.py index 1f0e6ffa8292b94db52cf031bb858be792eb23cc..49bfef55083a1ffb111a3567c9f4bb3aa50a9ef2 100644 --- a/satella/__init__.py +++ b/satella/__init__.py @@ -1 +1 @@ -__version__ = '2.24.1a2' +__version__ = '2.24.1a4' diff --git a/satella/coding/structures/syncable_droppable.py b/satella/coding/structures/syncable_droppable.py index fc02064f0c985163561f3ba5902776acc90d8008..a1f4c0a42bda220aaacb728dd84233eb0470f200 100644 --- a/satella/coding/structures/syncable_droppable.py +++ b/satella/coding/structures/syncable_droppable.py @@ -2,6 +2,7 @@ import bisect import itertools import math import typing as tp +import warnings from abc import ABCMeta, abstractmethod from satella.coding.concurrent.monitor import RMonitor @@ -163,9 +164,10 @@ class SyncableDroppable(RMonitor, tp.Generic[K, V]): and span_to_keep_in_memory. This may block for a while. + + .. warning:: This bugs out for now. For now, a UserWarning will be raised and nothing will be done. """ - self.cleanup_keep_in_db() - self.cleanup_keep_in_memory() + warnings.warn('Nothing done', UserWarning) def _cleanup_the_db(self) -> bool: """ diff --git a/tests/test_coding/test_syncable_droppable.py b/tests/test_coding/test_syncable_droppable.py index d319f1d8d5e26583a2af6e33f0e43b7101a6c268..fc6a6ff30745ffdfd1ba49572ea4e393ca71af8b 100644 --- a/tests/test_coding/test_syncable_droppable.py +++ b/tests/test_coding/test_syncable_droppable.py @@ -77,7 +77,7 @@ class TestSyncableDroppable(unittest.TestCase): sd.cleanup_keep_in_db() self.assertEqual(sd.start_entry, 200) self.assertEqual(db.data, []) - + self.assertWarns(UserWarning, lambda: sd.cleanup()) sd.cleanup_keep_in_memory() self.assertEqual(db.data, [(200, 5), (220, 5)]) synces = list(sd.on_sync_request())