We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
readBody
1 parent 34553ad commit 2ff5328Copy full SHA for 2ff5328
tests/test_twisted.py
@@ -3,6 +3,8 @@
3
from prometheus_client import CollectorRegistry, Counter, generate_latest
4
5
try:
6
+ from warnings import filterwarnings
7
+
8
from twisted.internet import reactor
9
from twisted.trial.unittest import TestCase
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"))
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
49
d.addCallback(readBody)
50
d.addCallback(self.assertEqual, generate_latest(self.registry))
51
0 commit comments