From 28b875521a84fa22cc55e5bcbd974ef3ce26ec4f Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Thu, 16 Jun 2022 10:16:13 -0600 Subject: [PATCH] Add cleanup files in const --- frigate/test/const.py | 1 + frigate/test/test_http.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frigate/test/const.py b/frigate/test/const.py index 9a851dc42..bef02e235 100644 --- a/frigate/test/const.py +++ b/frigate/test/const.py @@ -1,3 +1,4 @@ """Consts for testing.""" TEST_DB = "test.db" +TEST_DB_CLEANUPS = ["test.db", "test.db-shm", "test.db-wal"] diff --git a/frigate/test/test_http.py b/frigate/test/test_http.py index 75c7c0c50..ca8f578b1 100644 --- a/frigate/test/test_http.py +++ b/frigate/test/test_http.py @@ -14,7 +14,7 @@ from frigate.config import FrigateConfig from frigate.http import create_app from frigate.models import Event, Recordings -from frigate.test.const import TEST_DB +from frigate.test.const import TEST_DB, TEST_DB_CLEANUPS class TestHttp(unittest.TestCase): @@ -106,9 +106,8 @@ class TestHttp(unittest.TestCase): self.db.close() try: - os.remove("test.db") - os.remove("test.db-shm") - os.remove("test.db-wal") + for file in TEST_DB_CLEANUPS: + os.remove(file) except OSError: pass