diff options
Diffstat (limited to 'test/test_test.py')
-rw-r--r-- | test/test_test.py | 9 |
1 files changed, 4 insertions, 5 deletions
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): |