]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix a DeprecationWarning in twisted_test with Twisted 15.0.
authorBen Darnell <ben@bendarnell.com>
Fri, 30 Jan 2015 16:49:34 +0000 (11:49 -0500)
committerBen Darnell <ben@bendarnell.com>
Fri, 30 Jan 2015 16:49:34 +0000 (11:49 -0500)
tornado/test/twisted_test.py

index 9af06a7ac1e6f4a0c4911cff0026fb4326c394b3..732cb4cfaecf1adc4d3ee22edbca6b7306db1f68 100644 (file)
@@ -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()