From 6e4f537e37911c235d41310f7088aab2a8604cc7 Mon Sep 17 00:00:00 2001 From: Diego Date: Fri, 16 Oct 2026 14:53:34 -0300 Subject: [PATCH] Expect display-width padding in the expanded array test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cli_helpers 2.15.2, released 2026-10-16, aligns vertical output by display width (dbcli/cli_helpers#117), so the header 配列, two wide characters, gets two fewer padding spaces. The test had the old misalignment written down and fails with the new release. The expectation now has the aligned output, and cli_helpers >= 2.15.2 keeps the test from depending on which release is installed: 2.15.1 fails it, as it should, since it misaligns. --- changelog.rst | 7 +++++++ pyproject.toml | 2 +- tests/test_main.py | 5 +++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/changelog.rst b/changelog.rst index 81fbefe78..99f63deb7 100644 --- a/changelog.rst +++ b/changelog.rst @@ -6,6 +6,13 @@ Features: * Add a ``\service`` prompt token for connections made using ``service=...`` or ``PGSERVICE``. For example, set ``prompt = '\service> '``. +Internal: +--------- +* Require ``cli_helpers >= 2.15.2``. That release aligns vertical (expanded) + output by display width, so a header of wide characters like ``配列`` lines + up; ``test_format_array_output_expanded`` had the old misalignment written + down and fails with it. + 4.7.1 (2026-09-20) ================== diff --git a/pyproject.toml b/pyproject.toml index 1f21e60ea..71ee953ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ "psycopg-binary >= 3.0.14; sys_platform == 'win32'", "sqlparse >=0.3.0,<0.7", "configobj >= 5.0.6", - "cli_helpers[styles] >= 2.4.0", + "cli_helpers[styles] >= 2.15.2", # setproctitle is used to mask the password when running `ps` in command line. # But this is not necessary in Windows since the password is never shown in the # task manager. Also setproctitle is a hard dependency to install in Windows, diff --git a/tests/test_main.py b/tests/test_main.py index decae97b1..44dafd6d3 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -191,15 +191,16 @@ def test_format_array_output_expanded(executor): SELECT '{}', NULL, array[NULL] """ results = run(executor, statement, expanded=True) + # 配列 is two wide characters: its padding counts display width (cli_helpers 2.15.2+). expected = [ "-[ RECORD 1 ]-------------------------", "bigint_array | {1,2,3}", "nested_numeric_array | {{1,2},{3,4}}", - "配列 | {å,魚,текст}", + "配列 | {å,魚,текст}", "-[ RECORD 2 ]-------------------------", "bigint_array | {}", "nested_numeric_array | ", - "配列 | {}", + "配列 | {}", "SELECT 2", ] assert "\n".join(results) == "\n".join(expected)