tests.test_cli module

Common tests for all CLI basic features and templates for subcommands.

A test class earns its place here by sharing tests, never by grouping them. The module keeps two template classes, CLITableTests and CLIQueryTests. Each one gives its subclasses a battery of inherited behavior tests, for the price of a subcmd fixture and a little per-command data. All other tests are functions: a module inheriting no template writes module-level tests, the file being the grouping. Shared assertion logic is a module-level helper (check_packages_payload(), check_filtered_ids()), and the parametrize data of a command stays in the file of that command. A subcommand with no specific behavior needs no test_cli_*.py file.

The two templates stay classes by decision. A command×behavior parametrize was assessed and rejected: it pulls the specifics of each command out of its own file, into one central cross-product that is harder to read and to extend.

tests.test_cli.check_manager_selection(result, selected=('am', 'antidote', 'antigen', 'antigravity-cli-plugins', 'apk', 'app-manager', 'apt', 'apt-mint', 'aptitude', 'asdf', 'aura', 'basalt', 'bin', 'bob', 'bpkg', 'brew', 'bun', 'cargo', 'choosenim', 'claude-code-plugins', 'clib', 'composer', 'conda', 'cpan', 'cran', 'deb-get', 'dkp-pacman', 'dnf', 'dnf5', 'dotnet', 'elan', 'emacs', 'emerge', 'eopkg', 'fisher', 'flatpak', 'fwupd', 'gcloud', 'gem', 'getnf', 'gext', 'gh-ext', 'ghcup', 'go', 'guix', 'gup', 'haxelib', 'hyprpm', 'jpm', 'julia', 'juliaup', 'krew', 'lazy', 'luarocks', 'lure', 'mamba', 'mason', 'micro', 'microdnf', 'micromamba', 'miktex', 'mise', 'nala', 'nimble', 'nix', 'npm', 'octave', 'oh-my-fish', 'ollama', 'opam', 'opkg', 'pacman', 'pacstall', 'pamac', 'paru', 'pear', 'pearl', 'pi', 'pikaur', 'pip', 'pipx', 'pipxu', 'pixi', 'pkcon', 'pkgit', 'pkgm', 'platformio-core', 'pmerge', 'pnpm', 'protonplus', 'pwsh-gallery', 'pyenv', 'raco', 'roswell', 'rpm-ostree', 'rustup', 'sdkman', 'sheldon', 'skills', 'snap', 'soar', 'spack', 'steamcmd', 'stew', 'tlmgr', 'topgrade', 'trizen', 'uv', 'uvx', 'vagrant', 'vcpkg', 'vim-pack', 'vscode', 'vscodium', 'whalebrew', 'xbps', 'yarn', 'yarn-berry', 'yay', 'yazi', 'yum', 'zef', 'zerobrew', 'zeroinstall', 'zim', 'zinit', 'zplug', 'zvm', 'zypper'), reference_set=('am', 'antidote', 'antigen', 'antigravity-cli-plugins', 'apk', 'app-manager', 'apt', 'apt-mint', 'aptitude', 'asdf', 'aura', 'basalt', 'bin', 'bob', 'bpkg', 'brew', 'bun', 'cargo', 'choosenim', 'claude-code-plugins', 'clib', 'composer', 'conda', 'cpan', 'cran', 'deb-get', 'dkp-pacman', 'dnf', 'dnf5', 'dotnet', 'elan', 'emacs', 'emerge', 'eopkg', 'fisher', 'flatpak', 'fwupd', 'gcloud', 'gem', 'getnf', 'gext', 'gh-ext', 'ghcup', 'go', 'guix', 'gup', 'haxelib', 'hyprpm', 'jpm', 'julia', 'juliaup', 'krew', 'lazy', 'luarocks', 'lure', 'mamba', 'mason', 'micro', 'microdnf', 'micromamba', 'miktex', 'mise', 'nala', 'nimble', 'nix', 'npm', 'octave', 'oh-my-fish', 'ollama', 'opam', 'opkg', 'pacman', 'pacstall', 'pamac', 'paru', 'pear', 'pearl', 'pi', 'pikaur', 'pip', 'pipx', 'pipxu', 'pixi', 'pkcon', 'pkgit', 'pkgm', 'platformio-core', 'pmerge', 'pnpm', 'protonplus', 'pwsh-gallery', 'pyenv', 'raco', 'roswell', 'rpm-ostree', 'rustup', 'sdkman', 'sheldon', 'skills', 'snap', 'soar', 'spack', 'steamcmd', 'stew', 'tlmgr', 'topgrade', 'trizen', 'uv', 'uvx', 'vagrant', 'vcpkg', 'vim-pack', 'vscode', 'vscodium', 'whalebrew', 'xbps', 'yarn', 'yarn-berry', 'yay', 'yazi', 'yum', 'zef', 'zerobrew', 'zeroinstall', 'zim', 'zinit', 'zplug', 'zvm', 'zypper'), strict_selection_match=True, *, signals)[source]

Check that user-selected managers are found in CLI’s output.

To establish that mpm CLI is properly selecting managers, we search for signals in CLI logs, by matching regular expressions against <stdout> and <stderr>. This strategy close the gap of testing internal code testing and end user experience.

signals is the per-subcommand strategy answering “did this manager show up?”, taking (manager_id, stdout, stderr) and yielding booleans roughly sorted from most specific to more forgiving. Each test module defines its own and binds it here once, conventionally as check_selection = partial(check_manager_selection, signals=...), so the call sites read as assertions rather than as plumbing.

strict_selection_match check that all selected managers are properly reported in CLI output and none are missing.

Caution

At this stage of the CLI execution, the order in which the managers are reported doesn’t matter because:

This explain the use of set() everywhere in this method.

tests.test_cli.assert_no_manager_selected(result)[source]

Assert the run stopped on the No manager selected. exit-2 guard.

Shared by every subcommand test that deselects all managers (or selects only managers lacking the operation) and expects the run to refuse to proceed.

Return type:

None

tests.test_cli.report_rows(stdout)[source]

Map each package ID of a change report table to its row.

Whitespace runs collapse to one space: a terminal that paints a glyph wider than it advances gets one more space after it.

Return type:

dict[str, str]

tests.test_cli.check_report(stdout, expected)[source]

Assert the change report holds exactly the expected rows.

Each row carries its words.

Return type:

None

tests.test_cli.check_filtered_ids(result, expected_ids)[source]

Assert the serialized payload reports exactly expected_ids.

Return type:

None

tests.test_cli.test_executable_module()[source]

Try running the CLI as a Python module.

Use the current Python executable so we don’t have to worry about missing dependencies.

<stderr> holds what extra-platforms prints by itself on this host, and nothing more. That is nothing, except on a Linux distribution that extra-platforms does not recognize, like Omarchy with extra-platforms 14.0.1: each run then prints a request to report it.

tests.test_cli.test_debug_rerun_command(monkeypatch, argv, restrict_to, expected)[source]

The re-run hint of the error summary reproduces the current invocation.

tests.test_cli.test_timeout(invoke, slow_fake_pool)[source]

Check that timeout is handled gracefully: command exits 0 and logs a warning.

tests.test_cli.test_failed_maintenance_names_its_cause_on_the_trail(invoke, fake_pool, monkeypatch, command, method, detail, expected)[source]

The ✘ line of a failed sync or cleanup closes on its cause.

The cause comes from its error, after the details of the command. A failure with no known cause keeps those details alone.

tests.test_cli.test_summary(invoke, fake_pool, summary_arg, active_summary)[source]

Test the result on all combinations of optional summary options.

tests.test_cli.test_fatal_message_reaches_stderr_in_every_format(invoke, monkeypatch, table_format)[source]

A run stopping on a critical message reports it, in serialized output too.

The payload goes to <stdout> and logs to <stderr>, so neither spoils the other.

tests.test_cli.test_serialized_output_notes_ignored_columns(invoke, fake_pool, table_format, noted)[source]

A serialized document carries every field.

A --columns selection is then reported as ignored there, and applied to a table.

tests.test_cli.managers_table_signals(mid, stdout, stderr)[source]

Signals telling whether mid shows up in the mpm managers table.

Lives at module level so both the selection tests below and the dedicated managers subcommand suite (tests.test_cli_managers) share it through downward imports, instead of one test module importing the other sideways.

Return type:

Iterator[bool]

tests.test_cli.check_managers_table_selection(result, selected=('am', 'antidote', 'antigen', 'antigravity-cli-plugins', 'apk', 'app-manager', 'apt', 'apt-mint', 'aptitude', 'asdf', 'aura', 'basalt', 'bin', 'bob', 'bpkg', 'brew', 'bun', 'cargo', 'choosenim', 'claude-code-plugins', 'clib', 'composer', 'conda', 'cpan', 'cran', 'deb-get', 'dkp-pacman', 'dnf', 'dnf5', 'dotnet', 'elan', 'emacs', 'emerge', 'eopkg', 'fisher', 'flatpak', 'fwupd', 'gcloud', 'gem', 'getnf', 'gext', 'gh-ext', 'ghcup', 'go', 'guix', 'gup', 'haxelib', 'hyprpm', 'jpm', 'julia', 'juliaup', 'krew', 'lazy', 'luarocks', 'lure', 'mamba', 'mason', 'micro', 'microdnf', 'micromamba', 'miktex', 'mise', 'nala', 'nimble', 'nix', 'npm', 'octave', 'oh-my-fish', 'ollama', 'opam', 'opkg', 'pacman', 'pacstall', 'pamac', 'paru', 'pear', 'pearl', 'pi', 'pikaur', 'pip', 'pipx', 'pipxu', 'pixi', 'pkcon', 'pkgit', 'pkgm', 'platformio-core', 'pmerge', 'pnpm', 'protonplus', 'pwsh-gallery', 'pyenv', 'raco', 'roswell', 'rpm-ostree', 'rustup', 'sdkman', 'sheldon', 'skills', 'snap', 'soar', 'spack', 'steamcmd', 'stew', 'tlmgr', 'topgrade', 'trizen', 'uv', 'uvx', 'vagrant', 'vcpkg', 'vim-pack', 'vscode', 'vscodium', 'whalebrew', 'xbps', 'yarn', 'yarn-berry', 'yay', 'yazi', 'yum', 'zef', 'zerobrew', 'zeroinstall', 'zim', 'zinit', 'zplug', 'zvm', 'zypper'), reference_set=('am', 'antidote', 'antigen', 'antigravity-cli-plugins', 'apk', 'app-manager', 'apt', 'apt-mint', 'aptitude', 'asdf', 'aura', 'basalt', 'bin', 'bob', 'bpkg', 'brew', 'bun', 'cargo', 'choosenim', 'claude-code-plugins', 'clib', 'composer', 'conda', 'cpan', 'cran', 'deb-get', 'dkp-pacman', 'dnf', 'dnf5', 'dotnet', 'elan', 'emacs', 'emerge', 'eopkg', 'fisher', 'flatpak', 'fwupd', 'gcloud', 'gem', 'getnf', 'gext', 'gh-ext', 'ghcup', 'go', 'guix', 'gup', 'haxelib', 'hyprpm', 'jpm', 'julia', 'juliaup', 'krew', 'lazy', 'luarocks', 'lure', 'mamba', 'mason', 'micro', 'microdnf', 'micromamba', 'miktex', 'mise', 'nala', 'nimble', 'nix', 'npm', 'octave', 'oh-my-fish', 'ollama', 'opam', 'opkg', 'pacman', 'pacstall', 'pamac', 'paru', 'pear', 'pearl', 'pi', 'pikaur', 'pip', 'pipx', 'pipxu', 'pixi', 'pkcon', 'pkgit', 'pkgm', 'platformio-core', 'pmerge', 'pnpm', 'protonplus', 'pwsh-gallery', 'pyenv', 'raco', 'roswell', 'rpm-ostree', 'rustup', 'sdkman', 'sheldon', 'skills', 'snap', 'soar', 'spack', 'steamcmd', 'stew', 'tlmgr', 'topgrade', 'trizen', 'uv', 'uvx', 'vagrant', 'vcpkg', 'vim-pack', 'vscode', 'vscodium', 'whalebrew', 'xbps', 'yarn', 'yarn-berry', 'yay', 'yazi', 'yum', 'zef', 'zerobrew', 'zeroinstall', 'zim', 'zinit', 'zplug', 'zvm', 'zypper'), strict_selection_match=True, *, signals=<function managers_table_signals>)

Selection assertions reading the mpm managers table.

tests.test_cli.test_invalid_manager_selector(invoke, selector)[source]
tests.test_cli.test_unmaintained_marker_takes_the_deprecated_style(invoke)[source]

The (unmaintained) marker of a selector is painted like (DEPRECATED).

tests.test_cli.test_default_all_managers(invoke)[source]

Test all available managers are selected by default.

With no selector to answer about, managers reports its default detected view, so the platform defaults whose CLI is missing are left out. The wider views are covered in tests.test_cli_managers.

tests.test_cli.test_manager_shortcuts(invoke, manager_id)[source]

Test each manager selection shortcut.

tests.test_cli.test_conf_file_overrides_defaults(invoke, create_config)[source]
tests.test_cli.test_conf_file_cli_override(invoke, create_config)[source]
tests.test_cli.test_conf_and_parameter_mix_keep_order(invoke, create_config)[source]
tests.test_cli.reached_manager_signals(mid, stdout, stderr)[source]

Detect whether mpm reached a manager during the invocation.

Available managers appear in the N package total (brew: 0, ...) stats line; the manager id is matched by its <mid>: <count> slice instead of by tailing the stream because at --verbosity DEBUG a few Reset <logger> to WARNING lines trail the stats line. Unavailable ones surface as Skipped: ... lines tagged with the manager ID in their level prefix (debug:<mid>:): that message is demoted to DEBUG for implicit selection, so test invocations pass --verbosity DEBUG to keep both signals visible.

Return type:

Iterator[bool]

tests.test_cli.check_reached_selection(result, selected=('am', 'antidote', 'antigen', 'antigravity-cli-plugins', 'apk', 'app-manager', 'apt', 'apt-mint', 'aptitude', 'asdf', 'aura', 'basalt', 'bin', 'bob', 'bpkg', 'brew', 'bun', 'cargo', 'choosenim', 'claude-code-plugins', 'clib', 'composer', 'conda', 'cpan', 'cran', 'deb-get', 'dkp-pacman', 'dnf', 'dnf5', 'dotnet', 'elan', 'emacs', 'emerge', 'eopkg', 'fisher', 'flatpak', 'fwupd', 'gcloud', 'gem', 'getnf', 'gext', 'gh-ext', 'ghcup', 'go', 'guix', 'gup', 'haxelib', 'hyprpm', 'jpm', 'julia', 'juliaup', 'krew', 'lazy', 'luarocks', 'lure', 'mamba', 'mason', 'micro', 'microdnf', 'micromamba', 'miktex', 'mise', 'nala', 'nimble', 'nix', 'npm', 'octave', 'oh-my-fish', 'ollama', 'opam', 'opkg', 'pacman', 'pacstall', 'pamac', 'paru', 'pear', 'pearl', 'pi', 'pikaur', 'pip', 'pipx', 'pipxu', 'pixi', 'pkcon', 'pkgit', 'pkgm', 'platformio-core', 'pmerge', 'pnpm', 'protonplus', 'pwsh-gallery', 'pyenv', 'raco', 'roswell', 'rpm-ostree', 'rustup', 'sdkman', 'sheldon', 'skills', 'snap', 'soar', 'spack', 'steamcmd', 'stew', 'tlmgr', 'topgrade', 'trizen', 'uv', 'uvx', 'vagrant', 'vcpkg', 'vim-pack', 'vscode', 'vscodium', 'whalebrew', 'xbps', 'yarn', 'yarn-berry', 'yay', 'yazi', 'yum', 'zef', 'zerobrew', 'zeroinstall', 'zim', 'zinit', 'zplug', 'zvm', 'zypper'), reference_set=('am', 'antidote', 'antigen', 'antigravity-cli-plugins', 'apk', 'app-manager', 'apt', 'apt-mint', 'aptitude', 'asdf', 'aura', 'basalt', 'bin', 'bob', 'bpkg', 'brew', 'bun', 'cargo', 'choosenim', 'claude-code-plugins', 'clib', 'composer', 'conda', 'cpan', 'cran', 'deb-get', 'dkp-pacman', 'dnf', 'dnf5', 'dotnet', 'elan', 'emacs', 'emerge', 'eopkg', 'fisher', 'flatpak', 'fwupd', 'gcloud', 'gem', 'getnf', 'gext', 'gh-ext', 'ghcup', 'go', 'guix', 'gup', 'haxelib', 'hyprpm', 'jpm', 'julia', 'juliaup', 'krew', 'lazy', 'luarocks', 'lure', 'mamba', 'mason', 'micro', 'microdnf', 'micromamba', 'miktex', 'mise', 'nala', 'nimble', 'nix', 'npm', 'octave', 'oh-my-fish', 'ollama', 'opam', 'opkg', 'pacman', 'pacstall', 'pamac', 'paru', 'pear', 'pearl', 'pi', 'pikaur', 'pip', 'pipx', 'pipxu', 'pixi', 'pkcon', 'pkgit', 'pkgm', 'platformio-core', 'pmerge', 'pnpm', 'protonplus', 'pwsh-gallery', 'pyenv', 'raco', 'roswell', 'rpm-ostree', 'rustup', 'sdkman', 'sheldon', 'skills', 'snap', 'soar', 'spack', 'steamcmd', 'stew', 'tlmgr', 'topgrade', 'trizen', 'uv', 'uvx', 'vagrant', 'vcpkg', 'vim-pack', 'vscode', 'vscodium', 'whalebrew', 'xbps', 'yarn', 'yarn-berry', 'yay', 'yazi', 'yum', 'zef', 'zerobrew', 'zeroinstall', 'zim', 'zinit', 'zplug', 'zvm', 'zypper'), strict_selection_match=True, *, signals=<function reached_manager_signals>)

Selection assertions reading the per-manager stats and skip lines.

tests.test_cli.test_selector_precedence(invoke, args, expected)[source]
tests.test_cli.test_bar_plugin_path(invoke)[source]

Away from the home folder, the plugin path prints in full.

tests.test_cli.test_bar_plugin_path_shortens_the_home_folder(invoke)[source]

Under the home folder, the plugin path starts with ~.

tests.test_cli.test_bar_plugin_path_needs_a_source_install(invoke, monkeypatch)[source]

A compiled binary carries no plugin file to point at.

tests.test_cli.check_packages_payload(result, optional_keys=frozenset({}), reference_set=('am', 'antidote', 'antigen', 'antigravity-cli-plugins', 'apk', 'app-manager', 'apt', 'apt-mint', 'aptitude', 'asdf', 'aura', 'basalt', 'bin', 'bob', 'bpkg', 'brew', 'bun', 'cargo', 'choosenim', 'claude-code-plugins', 'clib', 'composer', 'conda', 'cpan', 'cran', 'deb-get', 'dkp-pacman', 'dnf', 'dnf5', 'dotnet', 'elan', 'emacs', 'emerge', 'eopkg', 'fisher', 'flatpak', 'fwupd', 'gcloud', 'gem', 'getnf', 'gext', 'gh-ext', 'ghcup', 'go', 'guix', 'gup', 'haxelib', 'hyprpm', 'jpm', 'julia', 'juliaup', 'krew', 'lazy', 'luarocks', 'lure', 'mamba', 'mason', 'micro', 'microdnf', 'micromamba', 'miktex', 'mise', 'nala', 'nimble', 'nix', 'npm', 'octave', 'oh-my-fish', 'ollama', 'opam', 'opkg', 'pacman', 'pacstall', 'pamac', 'paru', 'pear', 'pearl', 'pi', 'pikaur', 'pip', 'pipx', 'pipxu', 'pixi', 'pkcon', 'pkgit', 'pkgm', 'platformio-core', 'pmerge', 'pnpm', 'protonplus', 'pwsh-gallery', 'pyenv', 'raco', 'roswell', 'rpm-ostree', 'rustup', 'sdkman', 'sheldon', 'skills', 'snap', 'soar', 'spack', 'steamcmd', 'stew', 'tlmgr', 'topgrade', 'trizen', 'uv', 'uvx', 'vagrant', 'vcpkg', 'vim-pack', 'vscode', 'vscodium', 'whalebrew', 'xbps', 'yarn', 'yarn-berry', 'yay', 'yazi', 'yum', 'zef', 'zerobrew', 'zeroinstall', 'zim', 'zinit', 'zplug', 'zvm', 'zypper'))[source]

Validate the serialized {manager: {id, name, errors, packages}} payload.

The shared shape check of the package-reporting subcommands (installed, outdated, search) in --table-format json mode: every manager entry carries the standard keys (plus the subcommand’s optional_keys, like outdated’s upgrade_all_cli), and every package serializes a subset of the Package fields as strings.

reference_set defaults to the platform’s real default managers, but a caller pinned to fake_pool (like orphans, with no implementing manager on every platform) overrides it to match.

Return type:

None

class tests.test_cli.CLITableTests[source]

Bases: object

Test subcommands whose output is a configurable table.

Any table output is also allowed to be rendered in all serialization formats.

columns_registry: tuple = ()

The subcommand’s column registry (a tables.py *_COLUMNS constant).

Set by each subclass so the generic --columns tests below resolve column IDs to their header labels from the same source of truth the CLI uses.

columns_test_pair: tuple[str, str] = ('manager_id', 'package_id')

Two column IDs, guaranteed by the subcommand’s registry, that the generic projection test selects in this order. Overridden by subclasses whose registry has no package columns.

test_columns_projection(invoke, subcmd, fake_pool)[source]

--columns restricts and reorders the table, SQL-SELECT-style.

test_columns_unknown_id(invoke, subcmd, fake_pool)[source]

An unknown column ID fails fast, listing the accepted ones.

test_json_output(invoke, subcmd)[source]

JSON output is expected to be parseable if read from <stdout>.

Debug level messages are redirected to <stderr> and are not supposed to interfere with this behavior.

The one serialization case kept on the real pool, deliberately: it is what proves a live inventory survives serialization, whatever package names, versions and encodings the host’s managers report. The format matrix below runs on the fake pool, that property being a fact about the data rather than about each format.

test_serialized_output(invoke, subcmd, fake_pool, fmt)[source]

All serialization formats produce parseable output on <stdout>.

Debug messages go to <stderr> and must not leak into the structured output. Formats whose optional dependency is not installed are skipped.

Runs on the fake pool: the subject is the serializer, not the inventory feeding it, and re-querying every installed manager once per format made this the most expensive block in the suite (outdated alone spent sixteen minutes of one Windows runner’s time across its seven cases). test_json_output() keeps the live inventory covered.

tests.test_cli.test_all_table_rendering(invoke, fake_pool, mode)[source]

Every table format renders an inventory without crashing.

A module-level test rather than a CLITableTests method, because it names its own subcommand instead of reading the subcmd fixture: inherited, it ran the same invocation once per subclass, so fifty formats became three hundred cases of which two hundred and fifty were byte-identical.

The fake pool is what makes it an assertion rather than a coincidence. The real pool reports whatever the host happens to carry, so on a runner with an empty inventory every format rendered an empty table and the test proved nothing about formatting; the fake pool guarantees rows to render, on any host, at the price of no subprocess at all.

class tests.test_cli.CLIQueryTests[source]

Bases: object

Template for inventory subcommands taking an optional positional QUERY.

Runs against the deterministic fake_pool package set. Subclasses keep their own test_query_filter parametrize — the case data is the per-command filtering semantics — and delegate each case’s assertions to check_filtered_ids().

test_query_highlight(invoke, subcmd, fake_pool)[source]

The matched substring is wrapped in the theme’s green search style.

tests.test_cli.REAL_POOL_TEMPLATE_TESTS = frozenset({'test_json_output'})

Template tests deliberately driving the host’s own managers.

One per format family is the whole budget: proving a live inventory survives serialization is a fact about the data, so it needs one serializer rather than one case per serializer per subcommand. Everything else inherited runs on fake_pool.

tests.test_cli.TEMPLATE_TEST_METHODS = (((<function CLITableTests.test_columns_projection>,), (), 'CLITableTests.test_columns_projection'), ((<function CLITableTests.test_columns_unknown_id>,), (), 'CLITableTests.test_columns_unknown_id'), ((<function CLITableTests.test_json_output>,), (), 'CLITableTests.test_json_output'), ((<function CLITableTests.test_serialized_output>,), (), 'CLITableTests.test_serialized_output'), ((<function CLIQueryTests.test_query_highlight>,), (), 'CLIQueryTests.test_query_highlight'))

Every test a subcommand inherits by subclassing a template.

tests.test_cli.test_template_tests_read_their_subcommand(method)[source]

A template test must take subcmd, or it is the same test N times.

A method naming its own subcommand still gets inherited by every subclass, which runs the identical invocation once per subclass with nothing to tell the copies apart. test_all_table_rendering did exactly that: fifty formats collected as three hundred cases, two hundred and fifty of them byte-identical, each driving the real manager pool. Nothing in the run reported it, since duplicate work looks like coverage. A test that names its own subcommand belongs at module level, where it is collected once.

tests.test_cli.test_template_tests_default_to_the_fake_pool(method)[source]

A template test must take fake_pool unless it is a listed exception.

Omitting the fixture is how a test silently acquires the host’s real managers, and a template multiplies that by its subclasses. The exceptions are named in REAL_POOL_TEMPLATE_TESTS so adding one is a decision rather than an oversight.

tests.test_cli.test_teardown_interrupt_guard_exits_without_a_traceback(mode, returncode, quiet)[source]

A Ctrl+C after teardown exits on the spot rather than unwinding through it.

The guarded run exits with the shell’s 128 + SIGINT and says nothing. The control is killed by the signal instead, CPython re-raising an uncaught KeyboardInterrupt as the signal that caused it, and prints a traceback of interpreter frames on the way out. That traceback is the whole defect: off a real terminal its frames are threading’s thread-join internals, which read as a crash to a user who only asked twice for the run to stop.