Skip to content

Commit

Permalink
fix test_metrics test pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrai2 committed Oct 20, 2023
1 parent 1d06bb9 commit cb1a1a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/unit/metrics/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@

from prometheus_client import CollectorRegistry, Counter, Histogram, generate_latest

from logprep.metrics import metrics
from logprep.metrics.metrics import CounterMetric, HistogramMetric
from logprep.metrics.metrics import CounterMetric, HistogramMetric, GaugeMetric


class TestsMetrics:
def setup_method(self):
self.custom_registry = CollectorRegistry()

def teardown_method(self):
CounterMetric(name="", description="").trackers.clear()
HistogramMetric(name="", description="").trackers.clear()
GaugeMetric(name="", description="").trackers.clear()

def test_init_tracker_creates_metric(self):
metric = CounterMetric(
name="testmetric",
Expand Down

0 comments on commit cb1a1a7

Please sign in to comment.