Skip to content

Commit

Permalink
fix tests ignored by pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
bucko909 committed Aug 29, 2024
1 parent d7926bd commit 83781e3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/carbon/tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,18 @@ def test_counts_multiple_datapoints(self):

class DrainStrategyTest(TestCase):
def setUp(self):
settings = {
'MAX_CACHE_SIZE': float('inf'),
'CACHE_SIZE_HARD_MAX': float('inf'),
'CACHE_SIZE_LOW_WATERMARK': float('inf')
}
self._settings_patch = patch.dict('carbon.conf.settings', settings)
self._settings_patch.start()
self.metric_cache = _MetricCache()

def tearDown(self):
self._settings_patch.stop()

def test_bucketmax_strategy(self):
bucketmax_strategy = BucketMaxStrategy(self.metric_cache)
self.metric_cache.strategy = bucketmax_strategy
Expand Down Expand Up @@ -311,8 +321,18 @@ def test_time_sorted_strategy_min_lag(self):

class RandomStrategyTest(TestCase):
def setUp(self):
settings = {
'MAX_CACHE_SIZE': float('inf'),
'CACHE_SIZE_HARD_MAX': float('inf'),
'CACHE_SIZE_LOW_WATERMARK': float('inf')
}
self._settings_patch = patch.dict('carbon.conf.settings', settings)
self._settings_patch.start()
self.metric_cache = _MetricCache()

def tearDown(self):
self._settings_patch.stop()

def test_random_strategy(self):
self.metric_cache.store('foo', (123456, 1.0))
self.metric_cache.store('bar', (123457, 2.0))
Expand Down

0 comments on commit 83781e3

Please sign in to comment.