From 0abdb72e5854f430ea4463725931c68dbc2b6d8e Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Tue, 7 Apr 2026 17:22:35 -0400 Subject: [PATCH] make null string config test more robust This test is occasionally failing in CI since we started running tests in random order. The failure message says that the database cannot be found. However the test does not need a database to be selected in order to run. This may be true of other tests, so we generalize CLI_ARGS_WITHOUT_DB, as it may be used elsewhere if similar failures are observed. --- test/pytests/test_main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pytests/test_main.py b/test/pytests/test_main.py index 6f80b0f4..03f17528 100644 --- a/test/pytests/test_main.py +++ b/test/pytests/test_main.py @@ -34,7 +34,7 @@ login_path_file = os.path.join(project_root_dir, 'test', 'mylogin.cnf') os.environ["MYSQL_TEST_LOGIN_FILE"] = login_path_file -CLI_ARGS = [ +CLI_ARGS_WITHOUT_DB = [ "--user", USER, "--host", @@ -47,8 +47,8 @@ default_config_file, "--defaults-file", default_config_file, - TEST_DATABASE, ] +CLI_ARGS = CLI_ARGS_WITHOUT_DB + [TEST_DATABASE] @dbtest @@ -2139,7 +2139,7 @@ def test_null_string_config(monkeypatch): """) ) myclirc.flush() - args = CLI_ARGS + ['--myclirc', myclirc.name, '--format=table', '--execute', 'SELECT NULL'] + args = CLI_ARGS_WITHOUT_DB + ['--myclirc', myclirc.name, '--format=table', '--execute', 'SELECT NULL'] result = runner.invoke(mycli.main.click_entrypoint, args=args) assert '' in result.output assert '' not in result.output