From 490ea134edb8f209a331f828cef3bfb4e48fee33 Mon Sep 17 00:00:00 2001 From: Hubert Tarasiuk Date: Mon, 15 Jun 2015 11:47:51 +0200 Subject: [PATCH 2/9] Start HTTP test only when calling begin(). * testenv/test/http_test.py: Move self.do_test() from __init__ to begin(). --- testenv/test/http_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testenv/test/http_test.py b/testenv/test/http_test.py index 230eff8..32a3335 100644 --- a/testenv/test/http_test.py +++ b/testenv/test/http_test.py @@ -23,11 +23,13 @@ class HTTPTest(BaseTest): test_params, post_hook, protocols) + self.server_setup() + + def begin(self): with self: - # if any exception occurs, self.__exit__ will be immediately called - self.server_setup() self.do_test() print_green('Test Passed.') + return super(HTTPTest, self).begin() def instantiate_server_by(self, protocol): server = {HTTP: HTTPd, -- 2.4.3