From cd1bf031339d1055a659fec4f88499af6bafc8b7 Mon Sep 17 00:00:00 2001 From: Christopher Rosell Date: Sat, 29 Mar 2014 00:34:18 +0100 Subject: [PATCH] tests: Python 2.6's unittest module is terrible. --- tests/test_plugin_api_http_session.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_plugin_api_http_session.py b/tests/test_plugin_api_http_session.py index b0c24da2..a30f8118 100644 --- a/tests/test_plugin_api_http_session.py +++ b/tests/test_plugin_api_http_session.py @@ -8,12 +8,13 @@ class TestPluginAPIHTTPSession(unittest.TestCase): def test_read_timeout(self): session = HTTPSession() - with self.assertRaises(PluginError): + def stream_data(): res = session.get("http://httpbin.org/delay/6", timeout=3, stream=True) next(res.iter_content(8192)) + self.assertRaises(PluginError, stream_data) if __name__ == "__main__": unittest.main()