From: Roey Berman Date: Mon, 30 Jul 2012 10:37:17 +0000 (+0300) Subject: iostream_test: moved the server.close() call from write the after write callback... X-Git-Tag: v2.4.0~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ddbd7c18ac5c09725f03b650539ef6f47c4d5c0;p=thirdparty%2Ftornado.git iostream_test: moved the server.close() call from write the after write callback to just before the second read_until(). --- diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py index 68b5f26ae..99d6add2f 100644 --- a/tornado/test/iostream_test.py +++ b/tornado/test/iostream_test.py @@ -260,11 +260,12 @@ class TestIOStream(AsyncHTTPTestCase, LogTrapTestCase): server, client = self.make_iostream_pair() client.set_close_callback(self.stop) try: - server.write(OK, server.close) + server.write(OK) client.read_until(b("\r\n"), self.stop) res = self.wait() self.assertEqual(res, OK) + server.close() client.read_until(b("\r\n"), lambda x: x) # If _close_callback (self.stop) is not called, # an AssertionError: Async operation timed out after 5 seconds