From 5f159da4888f1b287b3688fe488946881d6a60ca Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 3 Dec 2015 18:45:37 +0100 Subject: [PATCH] fix tests --- test/test_test.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/test/test_test.py b/test/test_test.py index eaaf83d3e..bd92d8644 100644 --- a/test/test_test.py +++ b/test/test_test.py @@ -12,11 +12,8 @@ class TestDaemonManual: rsp = requests.get("http://localhost:%s/p/202:da" % d.port) assert rsp.ok assert rsp.status_code == 202 - tutils.raises( - "Connection aborted", - requests.get, - "http://localhost:%s/p/202:da" % d.port - ) + with tutils.raises(requests.ConnectionError): + requests.get("http://localhost:%s/p/202:da" % d.port) def test_startstop_ssl(self): d = test.Daemon(ssl=True) @@ -27,11 +24,8 @@ class TestDaemonManual: assert rsp.ok assert rsp.status_code == 202 d.shutdown() - tutils.raises( - "Connection aborted", - requests.get, - "http://localhost:%s/p/202:da" % d.port - ) + with tutils.raises(requests.ConnectionError): + requests.get("http://localhost:%s/p/202:da" % d.port) def test_startstop_ssl_explicit(self): ssloptions = dict( @@ -47,8 +41,5 @@ class TestDaemonManual: assert rsp.ok assert rsp.status_code == 202 d.shutdown() - tutils.raises( - "Connection aborted", - requests.get, - "http://localhost:%s/p/202:da" % d.port - ) + with tutils.raises(requests.ConnectionError): + requests.get("http://localhost:%s/p/202:da" % d.port)