From fd1f12d4c96ab6566e4a29f229f13d4535a59cdd Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 10 Jul 2016 11:04:21 -0400 Subject: [PATCH] Add ExpectLog to a noisy test case --- tornado/test/simple_httpclient_test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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): -- 2.47.2