From fde65270afb3855057a86b40c5996c86f58fe97b Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 30 Jul 2012 20:58:59 +1200 Subject: Testing examples and docs. --- test/test_test.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/test_test.py b/test/test_test.py index e32dce53..538fc056 100644 --- a/test/test_test.py +++ b/test/test_test.py @@ -7,11 +7,10 @@ logging.disable(logging.CRITICAL) class TestDaemonManual: def test_simple(self): - d = test.Daemon() - rsp = requests.get("http://localhost:%s/p/202"%d.port) - assert rsp.ok - assert rsp.status_code == 202 - d.shutdown() + with test.Daemon() as d: + rsp = requests.get("http://localhost:%s/p/202"%d.port) + assert rsp.ok + assert rsp.status_code == 202 tutils.raises(requests.ConnectionError, requests.get, "http://localhost:%s/p/202"%d.port) def test_startstop_ssl(self): -- cgit v1.2.3