Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter readBody deprecation notice in tests #947

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/test_twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from prometheus_client import CollectorRegistry, Counter, generate_latest

try:
from warnings import filterwarnings

from twisted.internet import reactor
from twisted.trial.unittest import TestCase
from twisted.web.client import Agent, readBody
Expand Down Expand Up @@ -40,6 +42,7 @@ def test_reports_metrics(self):
url = f"http://localhost:{port}/metrics"
d = agent.request(b"GET", url.encode("ascii"))

filterwarnings('ignore', category=DeprecationWarning)
csmarchbanks marked this conversation as resolved.
Show resolved Hide resolved
d.addCallback(readBody)
d.addCallback(self.assertEqual, generate_latest(self.registry))

Expand Down