From 95e378d136a5fd115469aa3931b551c50f8f93e1 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Sat, 3 Oct 2026 11:32:50 -0400 Subject: [PATCH] move test directory to mycli_test This is just best practice to avoid import collisions, since a third- party library named "test" can and does exist. --- AGENTS.md | 12 ++++++------ MANIFEST.in | 8 ++++---- changelog.md | 1 + {test => mycli_test}/__init__.py | 0 {test => mycli_test}/features/__init__.py | 0 {test => mycli_test}/features/auto_vertical.feature | 0 .../features/basic_commands.feature | 0 {test => mycli_test}/features/connection.feature | 0 {test => mycli_test}/features/crud_database.feature | 0 {test => mycli_test}/features/crud_table.feature | 0 {test => mycli_test}/features/db_utils.py | 0 {test => mycli_test}/features/environment.py | 4 ++-- .../features/fixture_data/help_commands.txt | 0 {test => mycli_test}/features/fixture_utils.py | 0 {test => mycli_test}/features/iocommands.feature | 0 {test => mycli_test}/features/named_queries.feature | 0 {test => mycli_test}/features/specials.feature | 0 {test => mycli_test}/features/steps/__init__.py | 0 .../features/steps/auto_vertical.py | 0 .../features/steps/basic_commands.py | 2 +- {test => mycli_test}/features/steps/connection.py | 4 ++-- .../features/steps/crud_database.py | 0 {test => mycli_test}/features/steps/crud_table.py | 0 {test => mycli_test}/features/steps/iocommands.py | 0 .../features/steps/named_queries.py | 0 {test => mycli_test}/features/steps/specials.py | 0 {test => mycli_test}/features/steps/utils.py | 0 {test => mycli_test}/features/steps/wrappers.py | 0 {test => mycli_test}/features/wrappager.py | 0 {test => mycli_test}/myclirc | 2 +- {test => mycli_test}/mylogin.cnf | Bin {test => mycli_test}/pytests/conftest.py | 2 +- {test => mycli_test}/pytests/test_app_state.py | 0 .../pytests/test_bash_completion.py | 0 {test => mycli_test}/pytests/test_batch_utils.py | 0 .../pytests/test_boundary_tunnel.py | 0 {test => mycli_test}/pytests/test_checkup.py | 0 {test => mycli_test}/pytests/test_cli_runner.py | 0 {test => mycli_test}/pytests/test_cli_utils.py | 0 {test => mycli_test}/pytests/test_clibuffer.py | 0 {test => mycli_test}/pytests/test_client.py | 0 .../pytests/test_client_commands.py | 0 .../pytests/test_client_connection.py | 0 {test => mycli_test}/pytests/test_client_query.py | 2 +- {test => mycli_test}/pytests/test_clistyle.py | 0 {test => mycli_test}/pytests/test_clitoolbar.py | 0 .../pytests/test_completer_use_switch.py | 0 .../pytests/test_completion_engine.py | 0 .../pytests/test_completion_refresher.py | 0 {test => mycli_test}/pytests/test_config.py | 2 +- .../pytests/test_delimitercommand.py | 0 {test => mycli_test}/pytests/test_dsn_aliases.py | 0 .../pytests/test_favoritequeries.py | 0 {test => mycli_test}/pytests/test_filepaths.py | 0 .../pytests/test_fish_completion.py | 0 {test => mycli_test}/pytests/test_fzf.py | 0 .../pytests/test_hybrid_redirection.py | 0 .../pytests/test_interactive_utils.py | 0 .../pytests/test_key_binding_utils.py | 0 {test => mycli_test}/pytests/test_key_bindings.py | 0 {test => mycli_test}/pytests/test_keyring_utils.py | 0 {test => mycli_test}/pytests/test_kubectl_tunnel.py | 0 {test => mycli_test}/pytests/test_macos_keychain.py | 0 {test => mycli_test}/pytests/test_main.py | 8 ++++---- .../pytests/test_main_modes_batch.py | 4 ++-- .../pytests/test_main_modes_execute.py | 0 .../pytests/test_main_modes_list_dsn.py | 0 .../pytests/test_main_modes_repl.py | 2 +- .../pytests/test_naive_completion.py | 2 +- {test => mycli_test}/pytests/test_output.py | 2 +- .../pytests/test_password_sources.py | 0 .../pytests/test_polars_completion.py | 0 .../pytests/test_polars_transform.py | 0 .../pytests/test_ptoolkit_fzf_history.py | 0 .../pytests/test_ptoolkit_history.py | 0 {test => mycli_test}/pytests/test_ptoolkit_utils.py | 0 {test => mycli_test}/pytests/test_query_runner.py | 2 +- .../pytests/test_schema_prefetcher.py | 0 .../test_smart_completion_public_schema_only.py | 2 +- .../pytests/test_special_commands_init.py | 0 .../pytests/test_special_dbcommands.py | 2 +- .../pytests/test_special_iocommands.py | 2 +- {test => mycli_test}/pytests/test_special_llm.py | 0 {test => mycli_test}/pytests/test_special_main.py | 0 {test => mycli_test}/pytests/test_special_source.py | 0 {test => mycli_test}/pytests/test_special_utils.py | 2 +- {test => mycli_test}/pytests/test_sql_utils.py | 0 {test => mycli_test}/pytests/test_sqlcompleter.py | 0 {test => mycli_test}/pytests/test_sqlexecute.py | 2 +- {test => mycli_test}/pytests/test_sqlresult.py | 0 {test => mycli_test}/pytests/test_ssh_tunnel.py | 0 {test => mycli_test}/pytests/test_string_utils.py | 0 {test => mycli_test}/pytests/test_tabular_output.py | 2 +- {test => mycli_test}/pytests/test_vault.py | 0 {test => mycli_test}/pytests/test_zsh_completion.py | 0 {test => mycli_test}/utils.py | 0 pyproject.toml | 6 +++--- 97 files changed, 39 insertions(+), 38 deletions(-) rename {test => mycli_test}/__init__.py (100%) rename {test => mycli_test}/features/__init__.py (100%) rename {test => mycli_test}/features/auto_vertical.feature (100%) rename {test => mycli_test}/features/basic_commands.feature (100%) rename {test => mycli_test}/features/connection.feature (100%) rename {test => mycli_test}/features/crud_database.feature (100%) rename {test => mycli_test}/features/crud_table.feature (100%) rename {test => mycli_test}/features/db_utils.py (100%) rename {test => mycli_test}/features/environment.py (97%) rename {test => mycli_test}/features/fixture_data/help_commands.txt (100%) rename {test => mycli_test}/features/fixture_utils.py (100%) rename {test => mycli_test}/features/iocommands.feature (100%) rename {test => mycli_test}/features/named_queries.feature (100%) rename {test => mycli_test}/features/specials.feature (100%) rename {test => mycli_test}/features/steps/__init__.py (100%) rename {test => mycli_test}/features/steps/auto_vertical.py (100%) rename {test => mycli_test}/features/steps/basic_commands.py (98%) rename {test => mycli_test}/features/steps/connection.py (89%) rename {test => mycli_test}/features/steps/crud_database.py (100%) rename {test => mycli_test}/features/steps/crud_table.py (100%) rename {test => mycli_test}/features/steps/iocommands.py (100%) rename {test => mycli_test}/features/steps/named_queries.py (100%) rename {test => mycli_test}/features/steps/specials.py (100%) rename {test => mycli_test}/features/steps/utils.py (100%) rename {test => mycli_test}/features/steps/wrappers.py (100%) rename {test => mycli_test}/features/wrappager.py (100%) rename {test => mycli_test}/myclirc (99%) rename {test => mycli_test}/mylogin.cnf (100%) rename {test => mycli_test}/pytests/conftest.py (85%) rename {test => mycli_test}/pytests/test_app_state.py (100%) rename {test => mycli_test}/pytests/test_bash_completion.py (100%) rename {test => mycli_test}/pytests/test_batch_utils.py (100%) rename {test => mycli_test}/pytests/test_boundary_tunnel.py (100%) rename {test => mycli_test}/pytests/test_checkup.py (100%) rename {test => mycli_test}/pytests/test_cli_runner.py (100%) rename {test => mycli_test}/pytests/test_cli_utils.py (100%) rename {test => mycli_test}/pytests/test_clibuffer.py (100%) rename {test => mycli_test}/pytests/test_client.py (100%) rename {test => mycli_test}/pytests/test_client_commands.py (100%) rename {test => mycli_test}/pytests/test_client_connection.py (100%) rename {test => mycli_test}/pytests/test_client_query.py (99%) rename {test => mycli_test}/pytests/test_clistyle.py (100%) rename {test => mycli_test}/pytests/test_clitoolbar.py (100%) rename {test => mycli_test}/pytests/test_completer_use_switch.py (100%) rename {test => mycli_test}/pytests/test_completion_engine.py (100%) rename {test => mycli_test}/pytests/test_completion_refresher.py (100%) rename {test => mycli_test}/pytests/test_config.py (99%) rename {test => mycli_test}/pytests/test_delimitercommand.py (100%) rename {test => mycli_test}/pytests/test_dsn_aliases.py (100%) rename {test => mycli_test}/pytests/test_favoritequeries.py (100%) rename {test => mycli_test}/pytests/test_filepaths.py (100%) rename {test => mycli_test}/pytests/test_fish_completion.py (100%) rename {test => mycli_test}/pytests/test_fzf.py (100%) rename {test => mycli_test}/pytests/test_hybrid_redirection.py (100%) rename {test => mycli_test}/pytests/test_interactive_utils.py (100%) rename {test => mycli_test}/pytests/test_key_binding_utils.py (100%) rename {test => mycli_test}/pytests/test_key_bindings.py (100%) rename {test => mycli_test}/pytests/test_keyring_utils.py (100%) rename {test => mycli_test}/pytests/test_kubectl_tunnel.py (100%) rename {test => mycli_test}/pytests/test_macos_keychain.py (100%) rename {test => mycli_test}/pytests/test_main.py (99%) rename {test => mycli_test}/pytests/test_main_modes_batch.py (99%) rename {test => mycli_test}/pytests/test_main_modes_execute.py (100%) rename {test => mycli_test}/pytests/test_main_modes_list_dsn.py (100%) rename {test => mycli_test}/pytests/test_main_modes_repl.py (99%) rename {test => mycli_test}/pytests/test_naive_completion.py (98%) rename {test => mycli_test}/pytests/test_output.py (99%) rename {test => mycli_test}/pytests/test_password_sources.py (100%) rename {test => mycli_test}/pytests/test_polars_completion.py (100%) rename {test => mycli_test}/pytests/test_polars_transform.py (100%) rename {test => mycli_test}/pytests/test_ptoolkit_fzf_history.py (100%) rename {test => mycli_test}/pytests/test_ptoolkit_history.py (100%) rename {test => mycli_test}/pytests/test_ptoolkit_utils.py (100%) rename {test => mycli_test}/pytests/test_query_runner.py (99%) rename {test => mycli_test}/pytests/test_schema_prefetcher.py (100%) rename {test => mycli_test}/pytests/test_smart_completion_public_schema_only.py (99%) rename {test => mycli_test}/pytests/test_special_commands_init.py (100%) rename {test => mycli_test}/pytests/test_special_dbcommands.py (99%) rename {test => mycli_test}/pytests/test_special_iocommands.py (99%) rename {test => mycli_test}/pytests/test_special_llm.py (100%) rename {test => mycli_test}/pytests/test_special_main.py (100%) rename {test => mycli_test}/pytests/test_special_source.py (100%) rename {test => mycli_test}/pytests/test_special_utils.py (99%) rename {test => mycli_test}/pytests/test_sql_utils.py (100%) rename {test => mycli_test}/pytests/test_sqlcompleter.py (100%) rename {test => mycli_test}/pytests/test_sqlexecute.py (99%) rename {test => mycli_test}/pytests/test_sqlresult.py (100%) rename {test => mycli_test}/pytests/test_ssh_tunnel.py (100%) rename {test => mycli_test}/pytests/test_string_utils.py (100%) rename {test => mycli_test}/pytests/test_tabular_output.py (99%) rename {test => mycli_test}/pytests/test_vault.py (100%) rename {test => mycli_test}/pytests/test_zsh_completion.py (100%) rename {test => mycli_test}/utils.py (100%) diff --git a/AGENTS.md b/AGENTS.md index e4ab46dd8..500f33093 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,12 +66,12 @@ A command line client for MySQL with auto-completion and syntax highlighting. ├── mycli/packages/utils/string_utils.py # generic string utilities ├── mycli/resources/completions/ # shell completions for CLI interface ├── mycli/types.py # shared types - ├── test/features/ # behave tests - ├── test/myclirc # mycli configuration used for tests - ├── test/mylogin.cnf # `mylogin.cnf` example used for tests - ├── test/pytests/ # pytest tests - ├── test/pytests/conftest.py # pytest configuration - └── test/utils.py # shared utilities for tests + ├── mycli_test/features/ # behave tests + ├── mycli_test/myclirc # mycli configuration used for tests + ├── mycli_test/mylogin.cnf # `mylogin.cnf` example used for tests + ├── mycli_test/pytests/ # pytest tests + ├── mycli_test/pytests/conftest.py # pytest configuration + └── mycli_test/utils.py # shared utilities for tests ## Development diff --git a/MANIFEST.in b/MANIFEST.in index a221e695c..32a79dcdc 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ include LICENSE.txt *.md *.rst doc/screenshots/* recursive-include mycli/resources/completions * -recursive-include test *.cnf -recursive-include test *.feature -recursive-include test *.py -recursive-include test *.txt +recursive-include mycli_test *.cnf +recursive-include mycli_test *.feature +recursive-include mycli_test *.py +recursive-include mycli_test *.txt diff --git a/changelog.md b/changelog.md index 2ede2b3cc..a01dca398 100644 --- a/changelog.md +++ b/changelog.md @@ -17,6 +17,7 @@ Internal * Move `password_sources.py` to a `credentials` package directory. * Create an `execution` package directory for `sql_execute.py` and `background_runner.py`. * Add `.txt` to text files without file extensions. +* Move `test` directory to `mycli_test`. v2.28.0 (2026/10/02) diff --git a/test/__init__.py b/mycli_test/__init__.py similarity index 100% rename from test/__init__.py rename to mycli_test/__init__.py diff --git a/test/features/__init__.py b/mycli_test/features/__init__.py similarity index 100% rename from test/features/__init__.py rename to mycli_test/features/__init__.py diff --git a/test/features/auto_vertical.feature b/mycli_test/features/auto_vertical.feature similarity index 100% rename from test/features/auto_vertical.feature rename to mycli_test/features/auto_vertical.feature diff --git a/test/features/basic_commands.feature b/mycli_test/features/basic_commands.feature similarity index 100% rename from test/features/basic_commands.feature rename to mycli_test/features/basic_commands.feature diff --git a/test/features/connection.feature b/mycli_test/features/connection.feature similarity index 100% rename from test/features/connection.feature rename to mycli_test/features/connection.feature diff --git a/test/features/crud_database.feature b/mycli_test/features/crud_database.feature similarity index 100% rename from test/features/crud_database.feature rename to mycli_test/features/crud_database.feature diff --git a/test/features/crud_table.feature b/mycli_test/features/crud_table.feature similarity index 100% rename from test/features/crud_table.feature rename to mycli_test/features/crud_table.feature diff --git a/test/features/db_utils.py b/mycli_test/features/db_utils.py similarity index 100% rename from test/features/db_utils.py rename to mycli_test/features/db_utils.py diff --git a/test/features/environment.py b/mycli_test/features/environment.py similarity index 97% rename from test/features/environment.py rename to mycli_test/features/environment.py index b61ed0b95..3d672a8e9 100644 --- a/test/features/environment.py +++ b/mycli_test/features/environment.py @@ -57,11 +57,11 @@ def before_all(context): "pager_boundary": "---boundary---", } - # todo: this line has no effect, and the pager is controlled from test/myclirc + # todo: this line has no effect, and the pager is controlled from mycli_test/myclirc os.environ['PAGER'] = ( f'{sys.executable} {os.path.join(context.package_root, "test/features/wrappager.py")} {context.conf["pager_boundary"]}' ) - source_myclirc = os.path.join(context.package_root, 'test', 'myclirc') + source_myclirc = os.path.join(context.package_root, 'mycli_test', 'myclirc') fd, context.myclirc_copy = tempfile.mkstemp(prefix='mycli-behave-', suffix='.myclirc') os.close(fd) shutil.copyfile(source_myclirc, context.myclirc_copy) diff --git a/test/features/fixture_data/help_commands.txt b/mycli_test/features/fixture_data/help_commands.txt similarity index 100% rename from test/features/fixture_data/help_commands.txt rename to mycli_test/features/fixture_data/help_commands.txt diff --git a/test/features/fixture_utils.py b/mycli_test/features/fixture_utils.py similarity index 100% rename from test/features/fixture_utils.py rename to mycli_test/features/fixture_utils.py diff --git a/test/features/iocommands.feature b/mycli_test/features/iocommands.feature similarity index 100% rename from test/features/iocommands.feature rename to mycli_test/features/iocommands.feature diff --git a/test/features/named_queries.feature b/mycli_test/features/named_queries.feature similarity index 100% rename from test/features/named_queries.feature rename to mycli_test/features/named_queries.feature diff --git a/test/features/specials.feature b/mycli_test/features/specials.feature similarity index 100% rename from test/features/specials.feature rename to mycli_test/features/specials.feature diff --git a/test/features/steps/__init__.py b/mycli_test/features/steps/__init__.py similarity index 100% rename from test/features/steps/__init__.py rename to mycli_test/features/steps/__init__.py diff --git a/test/features/steps/auto_vertical.py b/mycli_test/features/steps/auto_vertical.py similarity index 100% rename from test/features/steps/auto_vertical.py rename to mycli_test/features/steps/auto_vertical.py diff --git a/test/features/steps/basic_commands.py b/mycli_test/features/steps/basic_commands.py similarity index 98% rename from test/features/steps/basic_commands.py rename to mycli_test/features/steps/basic_commands.py index f04a9f2fa..18c5d5508 100644 --- a/test/features/steps/basic_commands.py +++ b/mycli_test/features/steps/basic_commands.py @@ -14,7 +14,7 @@ from behave import then, when import wrappers -from test.utils import TEMPFILE_PREFIX +from mycli_test.utils import TEMPFILE_PREFIX @when("we run dbcli") diff --git a/test/features/steps/connection.py b/mycli_test/features/steps/connection.py similarity index 89% rename from test/features/steps/connection.py rename to mycli_test/features/steps/connection.py index ea6daeb6c..4f376e43d 100644 --- a/test/features/steps/connection.py +++ b/mycli_test/features/steps/connection.py @@ -3,8 +3,8 @@ from behave import then, when import wrappers -from test.features.environment import get_db_name_from_context -from test.features.steps.utils import parse_cli_args_to_dict +from mycli_test.features.environment import get_db_name_from_context +from mycli_test.features.steps.utils import parse_cli_args_to_dict TEST_LOGIN_PATH = "test_login_path" diff --git a/test/features/steps/crud_database.py b/mycli_test/features/steps/crud_database.py similarity index 100% rename from test/features/steps/crud_database.py rename to mycli_test/features/steps/crud_database.py diff --git a/test/features/steps/crud_table.py b/mycli_test/features/steps/crud_table.py similarity index 100% rename from test/features/steps/crud_table.py rename to mycli_test/features/steps/crud_table.py diff --git a/test/features/steps/iocommands.py b/mycli_test/features/steps/iocommands.py similarity index 100% rename from test/features/steps/iocommands.py rename to mycli_test/features/steps/iocommands.py diff --git a/test/features/steps/named_queries.py b/mycli_test/features/steps/named_queries.py similarity index 100% rename from test/features/steps/named_queries.py rename to mycli_test/features/steps/named_queries.py diff --git a/test/features/steps/specials.py b/mycli_test/features/steps/specials.py similarity index 100% rename from test/features/steps/specials.py rename to mycli_test/features/steps/specials.py diff --git a/test/features/steps/utils.py b/mycli_test/features/steps/utils.py similarity index 100% rename from test/features/steps/utils.py rename to mycli_test/features/steps/utils.py diff --git a/test/features/steps/wrappers.py b/mycli_test/features/steps/wrappers.py similarity index 100% rename from test/features/steps/wrappers.py rename to mycli_test/features/steps/wrappers.py diff --git a/test/features/wrappager.py b/mycli_test/features/wrappager.py similarity index 100% rename from test/features/wrappager.py rename to mycli_test/features/wrappager.py diff --git a/test/myclirc b/mycli_test/myclirc similarity index 99% rename from test/myclirc rename to mycli_test/myclirc index 7235fb5f8..aa5d43867 100644 --- a/test/myclirc +++ b/mycli_test/myclirc @@ -274,7 +274,7 @@ keyword_casing = auto enable_pager = True # Choose a specific pager -pager = python test/features/wrappager.py ---boundary--- +pager = python mycli_test/features/wrappager.py ---boundary--- # Comma-separated sources to respect for a password, in order of precedence. # Valid choices: diff --git a/test/mylogin.cnf b/mycli_test/mylogin.cnf similarity index 100% rename from test/mylogin.cnf rename to mycli_test/mylogin.cnf diff --git a/test/pytests/conftest.py b/mycli_test/pytests/conftest.py similarity index 85% rename from test/pytests/conftest.py rename to mycli_test/pytests/conftest.py index f7ad9571a..dbfe6b665 100644 --- a/test/pytests/conftest.py +++ b/mycli_test/pytests/conftest.py @@ -3,7 +3,7 @@ import pytest from mycli.packages.execution import sql_execute -from test.utils import CHARACTER_SET, DATABASE, HOST, PASSWORD, PORT, USER, create_db, db_connection +from mycli_test.utils import CHARACTER_SET, DATABASE, HOST, PASSWORD, PORT, USER, create_db, db_connection @pytest.fixture(scope="function") diff --git a/test/pytests/test_app_state.py b/mycli_test/pytests/test_app_state.py similarity index 100% rename from test/pytests/test_app_state.py rename to mycli_test/pytests/test_app_state.py diff --git a/test/pytests/test_bash_completion.py b/mycli_test/pytests/test_bash_completion.py similarity index 100% rename from test/pytests/test_bash_completion.py rename to mycli_test/pytests/test_bash_completion.py diff --git a/test/pytests/test_batch_utils.py b/mycli_test/pytests/test_batch_utils.py similarity index 100% rename from test/pytests/test_batch_utils.py rename to mycli_test/pytests/test_batch_utils.py diff --git a/test/pytests/test_boundary_tunnel.py b/mycli_test/pytests/test_boundary_tunnel.py similarity index 100% rename from test/pytests/test_boundary_tunnel.py rename to mycli_test/pytests/test_boundary_tunnel.py diff --git a/test/pytests/test_checkup.py b/mycli_test/pytests/test_checkup.py similarity index 100% rename from test/pytests/test_checkup.py rename to mycli_test/pytests/test_checkup.py diff --git a/test/pytests/test_cli_runner.py b/mycli_test/pytests/test_cli_runner.py similarity index 100% rename from test/pytests/test_cli_runner.py rename to mycli_test/pytests/test_cli_runner.py diff --git a/test/pytests/test_cli_utils.py b/mycli_test/pytests/test_cli_utils.py similarity index 100% rename from test/pytests/test_cli_utils.py rename to mycli_test/pytests/test_cli_utils.py diff --git a/test/pytests/test_clibuffer.py b/mycli_test/pytests/test_clibuffer.py similarity index 100% rename from test/pytests/test_clibuffer.py rename to mycli_test/pytests/test_clibuffer.py diff --git a/test/pytests/test_client.py b/mycli_test/pytests/test_client.py similarity index 100% rename from test/pytests/test_client.py rename to mycli_test/pytests/test_client.py diff --git a/test/pytests/test_client_commands.py b/mycli_test/pytests/test_client_commands.py similarity index 100% rename from test/pytests/test_client_commands.py rename to mycli_test/pytests/test_client_commands.py diff --git a/test/pytests/test_client_connection.py b/mycli_test/pytests/test_client_connection.py similarity index 100% rename from test/pytests/test_client_connection.py rename to mycli_test/pytests/test_client_connection.py diff --git a/test/pytests/test_client_query.py b/mycli_test/pytests/test_client_query.py similarity index 99% rename from test/pytests/test_client_query.py rename to mycli_test/pytests/test_client_query.py index 59c927017..11707b9f8 100644 --- a/test/pytests/test_client_query.py +++ b/mycli_test/pytests/test_client_query.py @@ -6,7 +6,7 @@ from mycli import client_query, main from mycli.packages.sql_result.sql_result import SQLResult from mycli.types import Query -from test.utils import ( # type: ignore[attr-defined] +from mycli_test.utils import ( # type: ignore[attr-defined] FakeCursorBase, ReusableLock, make_bare_mycli, diff --git a/test/pytests/test_clistyle.py b/mycli_test/pytests/test_clistyle.py similarity index 100% rename from test/pytests/test_clistyle.py rename to mycli_test/pytests/test_clistyle.py diff --git a/test/pytests/test_clitoolbar.py b/mycli_test/pytests/test_clitoolbar.py similarity index 100% rename from test/pytests/test_clitoolbar.py rename to mycli_test/pytests/test_clitoolbar.py diff --git a/test/pytests/test_completer_use_switch.py b/mycli_test/pytests/test_completer_use_switch.py similarity index 100% rename from test/pytests/test_completer_use_switch.py rename to mycli_test/pytests/test_completer_use_switch.py diff --git a/test/pytests/test_completion_engine.py b/mycli_test/pytests/test_completion_engine.py similarity index 100% rename from test/pytests/test_completion_engine.py rename to mycli_test/pytests/test_completion_engine.py diff --git a/test/pytests/test_completion_refresher.py b/mycli_test/pytests/test_completion_refresher.py similarity index 100% rename from test/pytests/test_completion_refresher.py rename to mycli_test/pytests/test_completion_refresher.py diff --git a/test/pytests/test_config.py b/mycli_test/pytests/test_config.py similarity index 99% rename from test/pytests/test_config.py rename to mycli_test/pytests/test_config.py index 54b408424..ab721afdd 100644 --- a/test/pytests/test_config.py +++ b/mycli_test/pytests/test_config.py @@ -28,7 +28,7 @@ strip_matching_quotes, write_default_config, ) -from test.utils import TEMPFILE_PREFIX +from mycli_test.utils import TEMPFILE_PREFIX LOGIN_PATH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "../mylogin.cnf")) diff --git a/test/pytests/test_delimitercommand.py b/mycli_test/pytests/test_delimitercommand.py similarity index 100% rename from test/pytests/test_delimitercommand.py rename to mycli_test/pytests/test_delimitercommand.py diff --git a/test/pytests/test_dsn_aliases.py b/mycli_test/pytests/test_dsn_aliases.py similarity index 100% rename from test/pytests/test_dsn_aliases.py rename to mycli_test/pytests/test_dsn_aliases.py diff --git a/test/pytests/test_favoritequeries.py b/mycli_test/pytests/test_favoritequeries.py similarity index 100% rename from test/pytests/test_favoritequeries.py rename to mycli_test/pytests/test_favoritequeries.py diff --git a/test/pytests/test_filepaths.py b/mycli_test/pytests/test_filepaths.py similarity index 100% rename from test/pytests/test_filepaths.py rename to mycli_test/pytests/test_filepaths.py diff --git a/test/pytests/test_fish_completion.py b/mycli_test/pytests/test_fish_completion.py similarity index 100% rename from test/pytests/test_fish_completion.py rename to mycli_test/pytests/test_fish_completion.py diff --git a/test/pytests/test_fzf.py b/mycli_test/pytests/test_fzf.py similarity index 100% rename from test/pytests/test_fzf.py rename to mycli_test/pytests/test_fzf.py diff --git a/test/pytests/test_hybrid_redirection.py b/mycli_test/pytests/test_hybrid_redirection.py similarity index 100% rename from test/pytests/test_hybrid_redirection.py rename to mycli_test/pytests/test_hybrid_redirection.py diff --git a/test/pytests/test_interactive_utils.py b/mycli_test/pytests/test_interactive_utils.py similarity index 100% rename from test/pytests/test_interactive_utils.py rename to mycli_test/pytests/test_interactive_utils.py diff --git a/test/pytests/test_key_binding_utils.py b/mycli_test/pytests/test_key_binding_utils.py similarity index 100% rename from test/pytests/test_key_binding_utils.py rename to mycli_test/pytests/test_key_binding_utils.py diff --git a/test/pytests/test_key_bindings.py b/mycli_test/pytests/test_key_bindings.py similarity index 100% rename from test/pytests/test_key_bindings.py rename to mycli_test/pytests/test_key_bindings.py diff --git a/test/pytests/test_keyring_utils.py b/mycli_test/pytests/test_keyring_utils.py similarity index 100% rename from test/pytests/test_keyring_utils.py rename to mycli_test/pytests/test_keyring_utils.py diff --git a/test/pytests/test_kubectl_tunnel.py b/mycli_test/pytests/test_kubectl_tunnel.py similarity index 100% rename from test/pytests/test_kubectl_tunnel.py rename to mycli_test/pytests/test_kubectl_tunnel.py diff --git a/test/pytests/test_macos_keychain.py b/mycli_test/pytests/test_macos_keychain.py similarity index 100% rename from test/pytests/test_macos_keychain.py rename to mycli_test/pytests/test_macos_keychain.py diff --git a/test/pytests/test_main.py b/mycli_test/pytests/test_main.py similarity index 99% rename from test/pytests/test_main.py rename to mycli_test/pytests/test_main.py index 0ab8f9317..6f04ca5fb 100644 --- a/test/pytests/test_main.py +++ b/mycli_test/pytests/test_main.py @@ -58,7 +58,7 @@ from mycli.packages.sql_result.sql_result import SQLResult from mycli.packages.utils import cli_utils from mycli.types import Query -from test.utils import ( +from mycli_test.utils import ( DATABASE, HOST, PASSWORD, @@ -79,8 +79,8 @@ pytests_dir = os.path.abspath(os.path.dirname(__file__)) project_root_dir = os.path.abspath(os.path.join(pytests_dir, '..', '..')) -default_config_file = os.path.join(project_root_dir, 'test', 'myclirc') -login_path_file = os.path.join(project_root_dir, 'test', 'mylogin.cnf') +default_config_file = os.path.join(project_root_dir, 'mycli_test', 'myclirc') +login_path_file = os.path.join(project_root_dir, 'mycli_test', 'mylogin.cnf') os.environ["MYSQL_TEST_LOGIN_FILE"] = login_path_file CLI_ARGS_WITHOUT_DB = [ @@ -1994,7 +1994,7 @@ def test_init_command_multiple_arg(executor): @dbtest def test_global_init_commands(executor): """Tests that global init-commands from config are executed by default.""" - # The global init-commands section in test/myclirc sets sql_select_limit=9999 + # The global init-commands section in mycli_test/myclirc sets sql_select_limit=9999 sql = 'show variables like "sql_select_limit";' runner = CliRunner() result = runner.invoke(click_entrypoint, args=CLI_ARGS, input=sql) diff --git a/test/pytests/test_main_modes_batch.py b/mycli_test/pytests/test_main_modes_batch.py similarity index 99% rename from test/pytests/test_main_modes_batch.py rename to mycli_test/pytests/test_main_modes_batch.py index 11164a645..f0665609f 100644 --- a/test/pytests/test_main_modes_batch.py +++ b/mycli_test/pytests/test_main_modes_batch.py @@ -14,8 +14,8 @@ import mycli.cli_runner as cli_runner import mycli.main_modes.batch as batch_mode -import test.pytests.test_main as test_main_module -import test.utils as test_utils +import mycli_test.pytests.test_main as test_main_module +import mycli_test.utils as test_utils noninteractive_mock_mycli = cast(Any, test_main_module).noninteractive_mock_mycli TEMPFILE_PREFIX = cast(str, cast(Any, test_utils).TEMPFILE_PREFIX) diff --git a/test/pytests/test_main_modes_execute.py b/mycli_test/pytests/test_main_modes_execute.py similarity index 100% rename from test/pytests/test_main_modes_execute.py rename to mycli_test/pytests/test_main_modes_execute.py diff --git a/test/pytests/test_main_modes_list_dsn.py b/mycli_test/pytests/test_main_modes_list_dsn.py similarity index 100% rename from test/pytests/test_main_modes_list_dsn.py rename to mycli_test/pytests/test_main_modes_list_dsn.py diff --git a/test/pytests/test_main_modes_repl.py b/mycli_test/pytests/test_main_modes_repl.py similarity index 99% rename from test/pytests/test_main_modes_repl.py rename to mycli_test/pytests/test_main_modes_repl.py index af305eff0..f7c88bfa4 100644 --- a/test/pytests/test_main_modes_repl.py +++ b/mycli_test/pytests/test_main_modes_repl.py @@ -23,7 +23,7 @@ from mycli.packages.execution.sql_execute import SQLExecute from mycli.packages.special_commands import io_commands as iocommands from mycli.packages.sql_result.sql_result import SQLResult -from test.utils import make_streaming_cursor # type: ignore[attr-defined] +from mycli_test.utils import make_streaming_cursor # type: ignore[attr-defined] class DummyLogger: diff --git a/test/pytests/test_naive_completion.py b/mycli_test/pytests/test_naive_completion.py similarity index 98% rename from test/pytests/test_naive_completion.py rename to mycli_test/pytests/test_naive_completion.py index 80862d72c..3ebdbc998 100644 --- a/test/pytests/test_naive_completion.py +++ b/mycli_test/pytests/test_naive_completion.py @@ -4,7 +4,7 @@ from prompt_toolkit.document import Document import pytest -from test.utils import pygments_below +from mycli_test.utils import pygments_below @pytest.fixture diff --git a/test/pytests/test_output.py b/mycli_test/pytests/test_output.py similarity index 99% rename from test/pytests/test_output.py rename to mycli_test/pytests/test_output.py index 0c14af5c6..c31ac6b2f 100644 --- a/test/pytests/test_output.py +++ b/mycli_test/pytests/test_output.py @@ -22,7 +22,7 @@ from mycli.packages.execution.sql_execute import SQLExecute from mycli.packages.sql_result.sql_result import SQLResult from mycli.types import ImageProtocol -from test.utils import DummyFormatter, FakeCursorBase, make_bare_mycli, make_streaming_cursor # type: ignore[attr-defined] +from mycli_test.utils import DummyFormatter, FakeCursorBase, make_bare_mycli, make_streaming_cursor # type: ignore[attr-defined] def test_output_timing_logs_and_prints_with_default_style(monkeypatch: pytest.MonkeyPatch) -> None: diff --git a/test/pytests/test_password_sources.py b/mycli_test/pytests/test_password_sources.py similarity index 100% rename from test/pytests/test_password_sources.py rename to mycli_test/pytests/test_password_sources.py diff --git a/test/pytests/test_polars_completion.py b/mycli_test/pytests/test_polars_completion.py similarity index 100% rename from test/pytests/test_polars_completion.py rename to mycli_test/pytests/test_polars_completion.py diff --git a/test/pytests/test_polars_transform.py b/mycli_test/pytests/test_polars_transform.py similarity index 100% rename from test/pytests/test_polars_transform.py rename to mycli_test/pytests/test_polars_transform.py diff --git a/test/pytests/test_ptoolkit_fzf_history.py b/mycli_test/pytests/test_ptoolkit_fzf_history.py similarity index 100% rename from test/pytests/test_ptoolkit_fzf_history.py rename to mycli_test/pytests/test_ptoolkit_fzf_history.py diff --git a/test/pytests/test_ptoolkit_history.py b/mycli_test/pytests/test_ptoolkit_history.py similarity index 100% rename from test/pytests/test_ptoolkit_history.py rename to mycli_test/pytests/test_ptoolkit_history.py diff --git a/test/pytests/test_ptoolkit_utils.py b/mycli_test/pytests/test_ptoolkit_utils.py similarity index 100% rename from test/pytests/test_ptoolkit_utils.py rename to mycli_test/pytests/test_ptoolkit_utils.py diff --git a/test/pytests/test_query_runner.py b/mycli_test/pytests/test_query_runner.py similarity index 99% rename from test/pytests/test_query_runner.py rename to mycli_test/pytests/test_query_runner.py index a93df8862..c3f31b17e 100644 --- a/test/pytests/test_query_runner.py +++ b/mycli_test/pytests/test_query_runner.py @@ -18,7 +18,7 @@ from mycli.packages.execution.background_runner import BackgroundCursor, BackgroundSSCursor, QueryCancelled, QueryRunner from mycli.packages.execution.sql_execute import SQLExecute from mycli.packages.sql_result.sql_result import SQLResult -from test.utils import dbtest # type: ignore[attr-defined] +from mycli_test.utils import dbtest # type: ignore[attr-defined] @pytest.fixture diff --git a/test/pytests/test_schema_prefetcher.py b/mycli_test/pytests/test_schema_prefetcher.py similarity index 100% rename from test/pytests/test_schema_prefetcher.py rename to mycli_test/pytests/test_schema_prefetcher.py diff --git a/test/pytests/test_smart_completion_public_schema_only.py b/mycli_test/pytests/test_smart_completion_public_schema_only.py similarity index 99% rename from test/pytests/test_smart_completion_public_schema_only.py rename to mycli_test/pytests/test_smart_completion_public_schema_only.py index e1308c969..d1c7a7ac1 100644 --- a/test/pytests/test_smart_completion_public_schema_only.py +++ b/mycli_test/pytests/test_smart_completion_public_schema_only.py @@ -9,7 +9,7 @@ import pytest from mycli.packages.special_commands import main as special -from test.utils import pygments_below +from mycli_test.utils import pygments_below metadata = { "users": ["id", "email", "first_name", "last_name"], diff --git a/test/pytests/test_special_commands_init.py b/mycli_test/pytests/test_special_commands_init.py similarity index 100% rename from test/pytests/test_special_commands_init.py rename to mycli_test/pytests/test_special_commands_init.py diff --git a/test/pytests/test_special_dbcommands.py b/mycli_test/pytests/test_special_dbcommands.py similarity index 99% rename from test/pytests/test_special_dbcommands.py rename to mycli_test/pytests/test_special_dbcommands.py index 92fc1c947..bb30d2a63 100644 --- a/test/pytests/test_special_dbcommands.py +++ b/mycli_test/pytests/test_special_dbcommands.py @@ -10,7 +10,7 @@ from mycli.packages.special_commands import main as special_main from mycli.packages.special_commands.db_commands import list_databases, list_tables, ping, status from mycli.packages.sql_result.sql_result import SQLResult -from test.pytests.test_completion_engine import sorted_dicts +from mycli_test.pytests.test_completion_engine import sorted_dicts class FakeConnection: diff --git a/test/pytests/test_special_iocommands.py b/mycli_test/pytests/test_special_iocommands.py similarity index 99% rename from test/pytests/test_special_iocommands.py rename to mycli_test/pytests/test_special_iocommands.py index 7ec7517e6..316ef50c4 100644 --- a/test/pytests/test_special_iocommands.py +++ b/mycli_test/pytests/test_special_iocommands.py @@ -28,7 +28,7 @@ find_favorite_query_template_keys, ) from mycli.packages.sql_result.sql_result import SQLResult -from test.utils import TEMPFILE_PREFIX, db_connection, dbtest +from mycli_test.utils import TEMPFILE_PREFIX, db_connection, dbtest class FakeFavoriteQueries: diff --git a/test/pytests/test_special_llm.py b/mycli_test/pytests/test_special_llm.py similarity index 100% rename from test/pytests/test_special_llm.py rename to mycli_test/pytests/test_special_llm.py diff --git a/test/pytests/test_special_main.py b/mycli_test/pytests/test_special_main.py similarity index 100% rename from test/pytests/test_special_main.py rename to mycli_test/pytests/test_special_main.py diff --git a/test/pytests/test_special_source.py b/mycli_test/pytests/test_special_source.py similarity index 100% rename from test/pytests/test_special_source.py rename to mycli_test/pytests/test_special_source.py diff --git a/test/pytests/test_special_utils.py b/mycli_test/pytests/test_special_utils.py similarity index 99% rename from test/pytests/test_special_utils.py rename to mycli_test/pytests/test_special_utils.py index f86b4fe20..2ffb62729 100644 --- a/test/pytests/test_special_utils.py +++ b/mycli_test/pytests/test_special_utils.py @@ -23,7 +23,7 @@ get_warning_count, handle_cd_command, ) -from test.utils import TEMPFILE_PREFIX +from mycli_test.utils import TEMPFILE_PREFIX @pytest.fixture(autouse=True) diff --git a/test/pytests/test_sql_utils.py b/mycli_test/pytests/test_sql_utils.py similarity index 100% rename from test/pytests/test_sql_utils.py rename to mycli_test/pytests/test_sql_utils.py diff --git a/test/pytests/test_sqlcompleter.py b/mycli_test/pytests/test_sqlcompleter.py similarity index 100% rename from test/pytests/test_sqlcompleter.py rename to mycli_test/pytests/test_sqlcompleter.py diff --git a/test/pytests/test_sqlexecute.py b/mycli_test/pytests/test_sqlexecute.py similarity index 99% rename from test/pytests/test_sqlexecute.py rename to mycli_test/pytests/test_sqlexecute.py index c6d559fe2..db2c7f075 100644 --- a/test/pytests/test_sqlexecute.py +++ b/mycli_test/pytests/test_sqlexecute.py @@ -16,7 +16,7 @@ from mycli.packages.execution.sql_execute import ServerInfo, ServerSpecies, SQLExecute from mycli.packages.special_commands import io_commands as iocommands from mycli.packages.sql_result.sql_result import SQLResult -from test.utils import dbtest, is_expanded_output, make_streaming_cursor, run, set_expanded_output +from mycli_test.utils import dbtest, is_expanded_output, make_streaming_cursor, run, set_expanded_output def assert_result_equal( diff --git a/test/pytests/test_sqlresult.py b/mycli_test/pytests/test_sqlresult.py similarity index 100% rename from test/pytests/test_sqlresult.py rename to mycli_test/pytests/test_sqlresult.py diff --git a/test/pytests/test_ssh_tunnel.py b/mycli_test/pytests/test_ssh_tunnel.py similarity index 100% rename from test/pytests/test_ssh_tunnel.py rename to mycli_test/pytests/test_ssh_tunnel.py diff --git a/test/pytests/test_string_utils.py b/mycli_test/pytests/test_string_utils.py similarity index 100% rename from test/pytests/test_string_utils.py rename to mycli_test/pytests/test_string_utils.py diff --git a/test/pytests/test_tabular_output.py b/mycli_test/pytests/test_tabular_output.py similarity index 99% rename from test/pytests/test_tabular_output.py rename to mycli_test/pytests/test_tabular_output.py index 94c821732..068dbe0ef 100644 --- a/test/pytests/test_tabular_output.py +++ b/mycli_test/pytests/test_tabular_output.py @@ -12,7 +12,7 @@ from mycli.main import MyCli from mycli.packages.credentials.password_sources import PasswordCandidates from mycli.packages.sql_result.sql_result import SQLResult -from test.utils import HOST, PASSWORD, PORT, USER, dbtest +from mycli_test.utils import HOST, PASSWORD, PORT, USER, dbtest default_config_file = os.path.join(os.path.dirname(__file__), "../myclirc") diff --git a/test/pytests/test_vault.py b/mycli_test/pytests/test_vault.py similarity index 100% rename from test/pytests/test_vault.py rename to mycli_test/pytests/test_vault.py diff --git a/test/pytests/test_zsh_completion.py b/mycli_test/pytests/test_zsh_completion.py similarity index 100% rename from test/pytests/test_zsh_completion.py rename to mycli_test/pytests/test_zsh_completion.py diff --git a/test/utils.py b/mycli_test/utils.py similarity index 100% rename from test/utils.py rename to mycli_test/utils.py diff --git a/pyproject.toml b/pyproject.toml index a3f71857b..ce8fa8ba9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,7 +119,7 @@ ignore = [ [tool.ruff.lint.isort] force-sort-within-sections = true -known-first-party = ['mycli', 'test', 'steps'] +known-first-party = ['mycli', 'mycli_test', 'steps'] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = 'all' @@ -153,9 +153,9 @@ passenv = ['PYTEST_HOST', 'PYTEST_CHARSET', 'GITHUB_ACTION'] commands = [['uv', 'pip', 'install', '-e', '.[dev,llm,dataframe]'], - ['coverage', 'run', '-m', 'pytest', '-v', 'test'], + ['coverage', 'run', '-m', 'pytest', '-v', 'mycli_test'], ['coverage', 'report', '-m', '--sort=Miss'], - ['behave', 'test/features']] + ['behave', 'mycli_test/features']] commands_post = [['rm', '-f', '--', './.myclirc']] allowlist_externals = ['rm', 'uv']