]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
tests: replace remaining assertEquals() with assertEqual()
authorPierce Lopez <pierce.lopez@gmail.com>
Thu, 29 Aug 2019 03:34:54 +0000 (23:34 -0400)
committerPierce Lopez <pierce.lopez@gmail.com>
Sat, 31 Aug 2019 04:16:08 +0000 (00:16 -0400)
assertEquals() is deprecated, and python3.7/pytest can warn about it

tornado/test/httpserver_test.py
tornado/test/httputil_test.py
tornado/test/simple_httpclient_test.py
tornado/test/web_test.py

index 2a8b6a5b14b0efcda6bb2e01d93848b73b1de581..1bc8def83f187d45569523b41c4fac004d5467ef 100644 (file)
@@ -943,7 +943,7 @@ class GzipBaseTest(object):
 
     def test_uncompressed(self):
         response = self.fetch("/", method="POST", body="foo=bar")
-        self.assertEquals(json_decode(response.body), {u"foo": [u"bar"]})
+        self.assertEqual(json_decode(response.body), {u"foo": [u"bar"]})
 
 
 class GzipTest(GzipBaseTest, AsyncHTTPTestCase):
@@ -952,7 +952,7 @@ class GzipTest(GzipBaseTest, AsyncHTTPTestCase):
 
     def test_gzip(self):
         response = self.post_gzip("foo=bar")
-        self.assertEquals(json_decode(response.body), {u"foo": [u"bar"]})
+        self.assertEqual(json_decode(response.body), {u"foo": [u"bar"]})
 
 
 class GzipUnsupportedTest(GzipBaseTest, AsyncHTTPTestCase):
@@ -962,7 +962,7 @@ class GzipUnsupportedTest(GzipBaseTest, AsyncHTTPTestCase):
         # not a fatal error).
         with ExpectLog(gen_log, "Unsupported Content-Encoding"):
             response = self.post_gzip("foo=bar")
-        self.assertEquals(json_decode(response.body), {})
+        self.assertEqual(json_decode(response.body), {})
 
 
 class StreamingChunkSizeTest(AsyncHTTPTestCase):
index c094a09efa119b686b2ca4585172750342285f4f..2ebd9060394509d416162c29cf82d173e6ccfe33 100644 (file)
@@ -388,7 +388,7 @@ Foo: even
         headers.add("Foo", "2")
         headers.add("Foo", "3")
         headers2 = HTTPHeaders.parse(str(headers))
-        self.assertEquals(headers, headers2)
+        self.assertEqual(headers, headers2)
 
 
 class FormatTimestampTest(unittest.TestCase):
index bb9ca119d8a7fb3956a5d8d7011159343c465553..2933ea50e027ebacabce7553caa751fd4e76ebe5 100644 (file)
@@ -389,7 +389,7 @@ class SimpleHTTPClientTestMixin(object):
         if response.body == b"HTTP/1 required":
             self.skipTest("requires HTTP/1.x")
         else:
-            self.assertEquals(b"hello", response.body)
+            self.assertEqual(b"hello", response.body)
 
     def sync_body_producer(self, write):
         write(b"1234")
index d43d46bcfd461119e9dea2edb426880fc73e773a..5908710ac9f8fe2f18668563ec6fbc2796d5577e 100644 (file)
@@ -2284,7 +2284,7 @@ class StreamingRequestBodyTest(WebTestCase):
         self.data = Future()
         stream.write(b"4\r\nqwer\r\n")
         data = yield self.data
-        self.assertEquals(data, b"qwer")
+        self.assertEqual(data, b"qwer")
         stream.write(b"0\r\n\r\n")
         yield self.finished
         data = yield stream.read_until_close()