diff --git a/tests/test_asgi.py b/tests/test_asgi.py index 2a30eaf9..b2d9a70f 100644 --- a/tests/test_asgi.py +++ b/tests/test_asgi.py @@ -2,7 +2,6 @@ import sys from unittest import TestCase -from parameterized import parameterized from prometheus_client import CollectorRegistry, Counter, generate_latest from prometheus_client.exposition import CONTENT_TYPE_LATEST @@ -81,13 +80,7 @@ def get_all_output(self): break return outputs - @parameterized.expand([ - ["counter", "A counter", 2], - ["counter", "Another counter", 3], - ["requests", "Number of requests", 5], - ["failed_requests", "Number of failed requests", 7], - ]) - def test_reports_metrics(self, metric_name, help_text, increments): + def validate_metrics(self, metric_name, help_text, increments): """ ASGI app serves the metrics from the provided registry. """ @@ -116,3 +109,15 @@ def test_reports_metrics(self, metric_name, help_text, increments): self.assertIn("# HELP " + metric_name + "_total " + help_text + "\n", output) self.assertIn("# TYPE " + metric_name + "_total counter\n", output) self.assertIn(metric_name + "_total " + str(increments) + ".0\n", output) + + def test_report_metrics_1(self): + self.validate_metrics("counter", "A counter", 2) + + def test_report_metrics_2(self): + self.validate_metrics("counter", "Another counter", 3) + + def test_report_metrics_3(self): + self.validate_metrics("requests", "Number of requests", 5) + + def test_report_metrics_4(self): + self.validate_metrics("failed_requests", "Number of failed requests", 7) diff --git a/tests/test_wsgi.py b/tests/test_wsgi.py index 73585ef9..af251ac4 100644 --- a/tests/test_wsgi.py +++ b/tests/test_wsgi.py @@ -2,7 +2,6 @@ import sys from unittest import TestCase -from parameterized import parameterized from wsgiref.util import setup_testing_defaults from prometheus_client import make_wsgi_app @@ -34,13 +33,7 @@ def assertIn(self, item, iterable): ) ) - @parameterized.expand([ - ["counter", "A counter", 2], - ["counter", "Another counter", 3], - ["requests", "Number of requests", 5], - ["failed_requests", "Number of failed requests", 7], - ]) - def test_reports_metrics(self, metric_name, help_text, increments): + def validate_metrics(self, metric_name, help_text, increments): """ WSGI app serves the metrics from the provided registry. """ @@ -62,3 +55,15 @@ def test_reports_metrics(self, metric_name, help_text, increments): self.assertIn("# HELP " + metric_name + "_total " + help_text + "\n", output) self.assertIn("# TYPE " + metric_name + "_total counter\n", output) self.assertIn(metric_name + "_total " + str(increments) + ".0\n", output) + + def test_report_metrics_1(self): + self.validate_metrics("counter", "A counter", 2) + + def test_report_metrics_2(self): + self.validate_metrics("counter", "Another counter", 3) + + def test_report_metrics_3(self): + self.validate_metrics("requests", "Number of requests", 5) + + def test_report_metrics_4(self): + self.validate_metrics("failed_requests", "Number of failed requests", 7) diff --git a/tox.ini b/tox.ini index 34329226..6cfef861 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,6 @@ envlist = coverage-clean,py26,py27,py34,py35,py36,py37,py38,pypy,pypy3,{py27,py3 deps = coverage pytest - parameterized [testenv:py26] ; Last pytest and py version supported on py26 . @@ -16,7 +15,6 @@ deps = pytest==2.9.2 coverage futures - parameterized [testenv:py27] deps =