# HG changeset patch # User Thomas De Schampheleire # Date 2016-12-23 21:29:53 # Node ID 62eedbae0558983f90c9cede8f6f2f1e697b3a65 # Parent b35f74c2d661be54e1be7676f1fd1c4ae2f1da40 tests: remove intermediate init_stack method Grafted and modified by Mads Kiilerich. diff --git a/kallithea/tests/base.py b/kallithea/tests/base.py --- a/kallithea/tests/base.py +++ b/kallithea/tests/base.py @@ -146,14 +146,7 @@ class TestController(object): @pytest.fixture(autouse=True) def app_fixture(self): - self.wsgiapp = pylons.test.pylonsapp - self.init_stack(self.wsgiapp.config) - self.app = TestApp(self.wsgiapp) - return self.app - - def init_stack(self, config=None): - if not config: - config = pylons.test.pylonsapp.config + config = pylons.test.pylonsapp.config url._push_object(URLGenerator(config['routes.map'], environ)) pylons.app_globals._push_object(config['pylons.app_globals']) pylons.config._push_object(config) @@ -163,6 +156,8 @@ class TestController(object): pylons.translator._push_object(translator) h = NullHandler() logging.getLogger("kallithea").addHandler(h) + self.app = TestApp(pylons.test.pylonsapp) + return self.app def remove_all_notifications(self): # query().delete() does not (by default) trigger cascades