mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Add cleanup files in const
This commit is contained in:
parent
f7f29437d3
commit
28b875521a
@ -1,3 +1,4 @@
|
|||||||
"""Consts for testing."""
|
"""Consts for testing."""
|
||||||
|
|
||||||
TEST_DB = "test.db"
|
TEST_DB = "test.db"
|
||||||
|
TEST_DB_CLEANUPS = ["test.db", "test.db-shm", "test.db-wal"]
|
||||||
|
|||||||
@ -14,7 +14,7 @@ from frigate.config import FrigateConfig
|
|||||||
from frigate.http import create_app
|
from frigate.http import create_app
|
||||||
from frigate.models import Event, Recordings
|
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):
|
class TestHttp(unittest.TestCase):
|
||||||
@ -106,9 +106,8 @@ class TestHttp(unittest.TestCase):
|
|||||||
self.db.close()
|
self.db.close()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.remove("test.db")
|
for file in TEST_DB_CLEANUPS:
|
||||||
os.remove("test.db-shm")
|
os.remove(file)
|
||||||
os.remove("test.db-wal")
|
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user