diff options
| author | Alexander_Kabui <alexanderkabua@gmail.com> | 2026-10-04 09:40:07 +0300 |
|---|---|---|
| committer | Alexander_Kabui <alexanderkabua@gmail.com> | 2026-10-05 21:52:23 +0300 |
| commit | f063893efa75dd58a9ef125bbbc4e64f84721dd4 (patch) | |
| tree | ab5047e288ede2a3855ebf6d6bb3d67422584541 /test/python/test_groups.py | |
| parent | 0892471500f877513f4f983e74858e8421dd87ef (diff) | |
| download | genenetwork4-f063893efa75dd58a9ef125bbbc4e64f84721dd4.tar.gz | |
* 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.
Diffstat (limited to 'test/python/test_groups.py')
| -rw-r--r-- | test/python/test_groups.py | 9 |
1 files changed, 1 insertions, 8 deletions
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 |
