From 705fc1d58cded259c8a7b5030debd0e4f18e8de2 Mon Sep 17 00:00:00 2001 From: Eduard Ralph Date: Sat, 30 May 2026 00:10:49 +0200 Subject: [PATCH] TMGimporter: skip real-DB import tests on Windows The import tests drive a real in-memory Gramps database (make_database + db.load) through the shared _make_db() helper. On the Windows CI lane the only available Gramps is from conda-forge, which has no 6.1 yet, and Gramps 6.1 does not build in the conda env (its Windows build targets MSYS2 UCRT64, not conda). Run against that mismatched Gramps the real-DB import path hangs. Raise unittest.SkipTest from _make_db() on win32 so all 13 DB-backed test classes skip in one place; the pure-function tests (code stripping, date conversion, name parsing) do not call _make_db() and continue to run on Windows. On Linux every test runs unchanged (157 pass). Verified the Windows path with sys.platform forced to win32: 95 tests skip, 62 run and pass, the module is not all-skipped. Co-Authored-By: Claude Opus 4.8 (1M context) --- TMGimporter/tests/test_libtmg.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/TMGimporter/tests/test_libtmg.py b/TMGimporter/tests/test_libtmg.py index 9994d13d9..44cab9913 100644 --- a/TMGimporter/tests/test_libtmg.py +++ b/TMGimporter/tests/test_libtmg.py @@ -66,7 +66,23 @@ def __iter__(self): def _make_db(): - """Return a fresh in-memory Gramps database.""" + """Return a fresh in-memory Gramps database. + + Skips on Windows: these import tests drive a real in-memory Gramps + database, and on the Windows CI lane the only available Gramps comes + from conda-forge, which has no 6.1 yet (and Gramps 6.1 does not build + in the conda env -- its Windows build targets MSYS2 UCRT64, not conda). + Run against that mismatched Gramps the real-DB import path hangs, so + these tests are exercised on the Linux lane (which runs the Gramps + matching this branch) instead. The pure-function tests in this module + do not call this helper and still run on Windows. + """ + if sys.platform == "win32": + raise unittest.SkipTest( + "real-DB TMG import tests run on Linux; the Windows CI lane has no " + "Gramps matching this branch (6.1 is not on conda-forge), and the " + "import path hangs against a mismatched Gramps" + ) db = make_database("sqlite") db.load(":memory:", None) return db