From 9d2a7289e41977d5f8a3a633866443170883d4d0 Mon Sep 17 00:00:00 2001
From: Julian Rother <julian@cccv.de>
Date: Sat, 14 Aug 2021 03:48:08 +0200
Subject: [PATCH] Switched tests from tmpfile to in-memory databases

---
 tests/utils.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/utils.py b/tests/utils.py
index 7404f272..077ca751 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -49,13 +49,12 @@ class UffdTestCase(unittest.TestCase):
 									'password': self.test_data.get(user).get('password')}, follow_redirects=True)
 
 	def setUp(self):
-		self.dir = tempfile.mkdtemp()
 		# It would be far better to create a minimal app here, but since the
 		# session module depends on almost everything else, that is not really feasable
 		config = {
 			'TESTING': True,
 			'DEBUG': True,
-			'SQLALCHEMY_DATABASE_URI': 'sqlite:///%s/db.sqlite'%self.dir,
+			'SQLALCHEMY_DATABASE_URI': 'sqlite:///:memory:',
 			'SECRET_KEY': 'DEBUGKEY',
 			'LDAP_SERVICE_MOCK': True,
 			'MAIL_SKIP_SEND': True,
@@ -117,4 +116,3 @@ class UffdTestCase(unittest.TestCase):
 
 	def tearDown(self):
 		self.client.__exit__(None, None, None)
-		shutil.rmtree(self.dir)
-- 
GitLab