From f063893efa75dd58a9ef125bbbc4e64f84721dd4 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Sun, 4 Oct 2026 09:40:07 +0300 Subject: * test/python/server_test_case.py (ServerTestCase): probe SQL_URI credentials, not just the port Mirrors the Rust-side fix in 4a2cf5b on the Python suites: the old skip check connected to 127.0.0.1:3306, so tests ran (and failed) whenever a server was listening but rejected the credentials. database_reachable() now performs the real mysql_native_password handshake and skips only when the database is genuinely unusable; the five DB-mapped test modules use it instead of their local port probes. * test/python/test_{groups,group_by_name,group_strains,species,species_by_name}.py (database_reachable): use the shared probe; drop local copies. --- test/python/test_groups.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'test/python/test_groups.py') diff --git a/test/python/test_groups.py b/test/python/test_groups.py index 66466de..850266b 100644 --- a/test/python/test_groups.py +++ b/test/python/test_groups.py @@ -10,16 +10,9 @@ import socket import unittest from auth_helpers import TOKEN_ENV, auth_token -from server_test_case import HOST, PORT, ServerTestCase +from server_test_case import database_reachable, HOST, PORT, ServerTestCase -def database_reachable(): - try: - with socket.create_connection(("127.0.0.1", 3306), timeout=0.5): - return True - except OSError: - return False - class GroupsTest(ServerTestCase): EXTRA_ENV = TOKEN_ENV -- cgit 1.4.1