Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/myclirc → mycli_test/myclirc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions test/pytests/test_main.py → mycli_test/pytests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = [
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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']

Expand Down
Loading