From f71eca825cfd05196e94c0d671fcb1beb85010e8 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Fri, 3 Apr 2026 08:28:47 -0400 Subject: [PATCH] add missing @dbtest test-skip rules Some newish tests lacked the @dbtest decorator which ensures that the test is skipped when a connection is not present. --- changelog.md | 1 + test/pytests/test_main.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index 1cb41047..bf918abd 100644 --- a/changelog.md +++ b/changelog.md @@ -33,6 +33,7 @@ Internal * Refactor suggestion logic into declarative rules. * Factor the `--batch` execution modes out of `main.py`. * Sort coverage report in tox suite. +* Skip more tests when a database connection is not present. 1.67.1 (2026/03/28) diff --git a/test/pytests/test_main.py b/test/pytests/test_main.py index e2c19603..92e29a45 100644 --- a/test/pytests/test_main.py +++ b/test/pytests/test_main.py @@ -143,11 +143,13 @@ def test_select_from_empty_table(executor): assert expected in result.output +@dbtest def test_is_valid_connection_scheme_valid(executor, capsys): is_valid, scheme = is_valid_connection_scheme(f"mysql://test@{DEFAULT_HOST}:{DEFAULT_PORT}/dev") assert is_valid +@dbtest def test_is_valid_connection_scheme_invalid(executor, capsys): is_valid, scheme = is_valid_connection_scheme(f"nope://test@{DEFAULT_HOST}:{DEFAULT_PORT}/dev") assert not is_valid @@ -2154,6 +2156,7 @@ def test_execute_arg_supersedes_batch_file(monkeypatch): os.remove(batch_file.name) +@dbtest def test_null_string_config(monkeypatch): monkeypatch.setattr(MyCli, 'system_config_files', []) monkeypatch.setattr(MyCli, 'pwd_config_file', os.devnull)