Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def f(r):
try:
f(True)
except ValueError:
raised = True
pass
self.assertEqual(1, self.registry.get_sample_value('c'))

def test_block_decorator(self):
Expand Down Expand Up @@ -315,7 +315,7 @@ def test_invalid_names_raise(self):
self.assertRaises(ValueError, Summary, 'c', '', labelnames=['quantile'])

def test_empty_labels_list(self):
h = Histogram('h', 'help', [], registry=self.registry)
Histogram('h', 'help', [], registry=self.registry)
self.assertEqual(0, self.registry.get_sample_value('h_sum'))

def test_wrapped_original_class(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_exposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from prometheus_client import CollectorRegistry, generate_latest
from prometheus_client import push_to_gateway, pushadd_to_gateway, delete_from_gateway
from prometheus_client import CONTENT_TYPE_LATEST, instance_ip_grouping_key
from prometheus_client import core
from prometheus_client.exposition import default_handler, basic_auth_handler, MetricsHandler

try:
Expand Down Expand Up @@ -207,7 +206,8 @@ def test_instance_ip_grouping_key(self):
self.assertTrue('' != instance_ip_grouping_key()['instance'])

def test_metrics_handler(self):
MyHandler = MetricsHandler.factory(core.REGISTRY)
handler = MetricsHandler.factory(self.registry)
self.assertEqual(handler.registry, self.registry)


if __name__ == '__main__':
Expand Down
2 changes: 2 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def test_simple_summary(self):
a_count 1
a_sum 2
""")
summary = SummaryMetricFamily("a", "help", count_value=1, sum_value=2)
self.assertEqual([summary], list(families))

def test_summary_quantiles(self):
families = text_string_to_metric_families("""# TYPE a summary
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ ignore =
E501,
E722,
E741,
F841,
W293,
W503
import-order-style = google
Expand Down