diff --git a/tests/test_api_core.py b/tests/test_api_core.py index 7d7d1958..96f17862 100644 --- a/tests/test_api_core.py +++ b/tests/test_api_core.py @@ -351,8 +351,6 @@ class TestLongJobLock(unittest.TestCase): self.api = PromptManagerAPI(db=database) def _run(self, coro): - import asyncio - return asyncio.run(coro) def test_second_acquire_is_refused_until_first_releases(self): @@ -825,8 +823,6 @@ class TestInstanceHelpers(FolderPathsFixture): self.addCleanup(setattr, GalleryConfig, "MONITORING_DIRECTORIES", orig_dirs) def _run(self, coro): - import asyncio - return asyncio.run(coro) def test_run_in_executor_with_kwargs(self): diff --git a/tests/test_library.py b/tests/test_library.py index 24540f24..e7585639 100644 --- a/tests/test_library.py +++ b/tests/test_library.py @@ -143,8 +143,6 @@ class TestLibrary(unittest.TestCase): self.db.get_library_positive(positive, variant_limit=201) def test_sorts_keysets_survive_anchor_deletion_and_insertions_without_writes(self): - import sqlite3 - a = self.save("Alpha", rating=2, tags=["tag"]) b = self.save("beta", rating=5) c = self.save("charlie") diff --git a/utils/diagnostics.py b/utils/diagnostics.py index 61172ece..e532e9d3 100644 --- a/utils/diagnostics.py +++ b/utils/diagnostics.py @@ -386,14 +386,9 @@ class GalleryDiagnostics: except ImportError: self.logger.error(" [FAIL] PIL (Pillow): NOT AVAILABLE") - # Check sqlite3 - try: - import sqlite3 - - dependencies["sqlite3"] = True - self.logger.info(f" [PASS] sqlite3: {sqlite3.sqlite_version}") - except ImportError: - self.logger.error(" [FAIL] sqlite3: NOT AVAILABLE") + # sqlite3 is imported at the top of this module, so it is always here. + dependencies["sqlite3"] = True + self.logger.info(f" [PASS] sqlite3: {sqlite3.sqlite_version}") all_deps_ok = all(dependencies.values())