From: Pierce Lopez Date: Thu, 29 Aug 2019 03:34:54 +0000 (-0400) Subject: tests: replace remaining assertEquals() with assertEqual() X-Git-Tag: v6.1.0b1~58^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=500adb0d8c7c396433f28b7226333a5156268cd5;p=thirdparty%2Ftornado.git tests: replace remaining assertEquals() with assertEqual() assertEquals() is deprecated, and python3.7/pytest can warn about it --- diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py index 2a8b6a5b1..1bc8def83 100644 --- a/tornado/test/httpserver_test.py +++ b/tornado/test/httpserver_test.py @@ -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): diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py index c094a09ef..2ebd90603 100644 --- a/tornado/test/httputil_test.py +++ b/tornado/test/httputil_test.py @@ -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): diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index bb9ca119d..2933ea50e 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -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") diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index d43d46bcf..5908710ac 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -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()