File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Original file line number Diff line number Diff line change 3
3
from prometheus_client import CollectorRegistry , Counter , generate_latest
4
4
5
5
try :
6
+ from warnings import filterwarnings
7
+
6
8
from twisted .internet import reactor
7
9
from twisted .trial .unittest import TestCase
8
10
from twisted .web .client import Agent , readBody
@@ -40,6 +42,10 @@ def test_reports_metrics(self):
40
42
url = f"http://localhost:{ port } /metrics"
41
43
d = agent .request (b"GET" , url .encode ("ascii" ))
42
44
45
+ # Ignore expected DeprecationWarning.
46
+ filterwarnings ("ignore" , category = DeprecationWarning , message = "Using readBody "
47
+ "with a transport that does not have an abortConnection method" )
48
+
43
49
d .addCallback (readBody )
44
50
d .addCallback (self .assertEqual , generate_latest (self .registry ))
45
51
You can’t perform that action at this time.
0 commit comments