From 3675ce9049ee5fd02f4b5c5dc5be6505c7004dcc Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Feb 27 2018 10:30:34 +0000 Subject: Delete app and test client after tests to prevent them from staying in memory --- diff --git a/tests/__init__.py b/tests/__init__.py index 1cf6d16..4b355de 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -267,11 +267,11 @@ class SimplePagureTest(unittest.TestCase): pagure_config['ATTACHMENTS_FOLDER'] = os.path.join( self.path, 'attachments') - app = pagure.flask_app.create_app({'DB_URL': self.dbpath}) + self._app = pagure.flask_app.create_app({'DB_URL': self.dbpath}) # Remove the log handlers for the tests - app.logger.handlers = [] + self._app.logger.handlers = [] - self.app = app.test_client() + self.app = self._app.test_client() self.session = pagure.lib.create_session(self.dbpath) def tearDown(self): @@ -293,6 +293,9 @@ class SimplePagureTest(unittest.TestCase): shutil.rmtree(self.path) self.path = None + del self.app + del self._app + def get_csrf(self, url='/new', output=None): """Retrieve a CSRF token from given URL.""" if output is None: