From: Ben Darnell Date: Sun, 10 Jul 2016 15:04:21 +0000 (-0400) Subject: Add ExpectLog to a noisy test case X-Git-Tag: v4.4.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd1f12d4c96ab6566e4a29f229f13d4535a59cdd;p=thirdparty%2Ftornado.git Add ExpectLog to a noisy test case --- diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index a5624af25..861602b86 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -631,12 +631,13 @@ class HTTP204NoContentTestCase(AsyncHTTPTestCase): def test_204_invalid_content_length(self): # 204 status with non-zero content length is malformed - response = self.fetch("/?error=1") - if not self.http1: - self.skipTest("requires HTTP/1.x") - if self.http_client.configured_class != SimpleAsyncHTTPClient: - self.skipTest("curl client accepts invalid headers") - self.assertEqual(response.code, 599) + with ExpectLog(gen_log, ".*Response with code 204 should not have body"): + response = self.fetch("/?error=1") + if not self.http1: + self.skipTest("requires HTTP/1.x") + if self.http_client.configured_class != SimpleAsyncHTTPClient: + self.skipTest("curl client accepts invalid headers") + self.assertEqual(response.code, 599) class HostnameMappingTestCase(AsyncHTTPTestCase):