From: Ben Darnell Date: Fri, 30 Jan 2015 16:49:34 +0000 (-0500) Subject: Fix a DeprecationWarning in twisted_test with Twisted 15.0. X-Git-Tag: v4.1.0b2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49024f1bef6a632c59287f5f0e65626e96061d96;p=thirdparty%2Ftornado.git Fix a DeprecationWarning in twisted_test with Twisted 15.0. --- diff --git a/tornado/test/twisted_test.py b/tornado/test/twisted_test.py index 9af06a7ac..732cb4cfa 100644 --- a/tornado/test/twisted_test.py +++ b/tornado/test/twisted_test.py @@ -24,6 +24,7 @@ import shutil import signal import tempfile import threading +import warnings try: import fcntl @@ -444,7 +445,11 @@ class CompatibilityTests(unittest.TestCase): # a Protocol. client = Agent(self.reactor) response = yield client.request('GET', url) - body[0] = yield readBody(response) + with warnings.catch_warnings(): + # readBody has a buggy DeprecationWarning in Twisted 15.0: + # https://twistedmatrix.com/trac/changeset/43379 + warnings.simplefilter('ignore', category=DeprecationWarning) + body[0] = yield readBody(response) self.stop_loop() self.io_loop.add_callback(f) runner()