6
6
from django_prometheus .testutils import PrometheusTestCaseMixin
7
7
8
8
9
+ class BaseDbMetricTest (PrometheusTestCaseMixin , TestCase ):
10
+ # https://docs.djangoproject.com/en/2.2/topics/testing/tools/#django.test.SimpleTestCase.databases
11
+ databases = '__all__'
12
+
13
+
9
14
@skipUnless (connections ['test_db_1' ].vendor == 'sqlite' ,
10
15
"Skipped unless test_db_1 uses sqlite" )
11
- class TestDbMetrics (PrometheusTestCaseMixin , TestCase ):
16
+ class TestDbMetrics (BaseDbMetricTest ):
12
17
"""Test django_prometheus.db metrics.
13
18
14
19
Note regarding the values of metrics: many tests interact with the
@@ -59,7 +64,7 @@ def testExecuteMany(self):
59
64
60
65
@skipUnless ('postgresql' in connections ,
61
66
"Skipped unless postgresql database is enabled" )
62
- class TestPostgresDbMetrics (PrometheusTestCaseMixin , TestCase ):
67
+ class TestPostgresDbMetrics (BaseDbMetricTest ):
63
68
"""Test django_prometheus.db metrics for postgres backend.
64
69
65
70
Note regarding the values of metrics: many tests interact with the
@@ -82,7 +87,7 @@ def testCounters(self):
82
87
83
88
@skipUnless ('mysql' in connections ,
84
89
"Skipped unless mysql database is enabled" )
85
- class TestMysDbMetrics (PrometheusTestCaseMixin , TestCase ):
90
+ class TestMysDbMetrics (BaseDbMetricTest ):
86
91
"""Test django_prometheus.db metrics for mys backend.
87
92
88
93
Note regarding the values of metrics: many tests interact with the
0 commit comments