From eb1deaffcdfd0207a9281b9ddf638a41f7ca4137 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 20 Jul 2024 02:25:19 -0400 Subject: [PATCH] test: Close SQLite connections before cleanup on Windows --- tests/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 0207e07c..93a46095 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,6 +8,7 @@ from scrapyd import Config from scrapyd.app import application +from scrapyd.utils import get_spider_queues from scrapyd.website import Root from tests import root_add_version @@ -29,6 +30,9 @@ def root(request): yield Root(config, app) + for spiderqueue in get_spider_queues(config).values(): + spiderqueue.q.conn.close() + for setting in ("dbs_dir", "eggs_dir"): directory = os.path.realpath(config.get(setting)) basedir = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))