tests.test_pool module¶

tests.test_pool.test_manager_definition_inventory()[source]¶

Check every class implementing a package manager is in the pool.

tests.test_pool.test_manager_classes_order()[source]¶

Check manager classes are ordered by their IDs.

tests.test_pool.test_manager_count()[source]¶

Check all implemented package managers are accounted for, and unique.

tests.test_pool.test_shared_lock_families_are_disjoint()[source]¶

No manager may belong to two lock families, or its lane grouping is ambiguous.

tests.test_pool.test_shared_lock_family_members_exist_in_pool()[source]¶

Every lock-family member must be a real manager id (catches typos).

tests.test_pool.test_lock_families_nest_in_label_groups()[source]¶

Every lock family must sit inside a single ecosystem label group.

The two constants answer different questions. MANAGER_LABEL_GROUPS groups managers by the packaging ecosystem an issue lands in, SHARED_LOCK_FAMILIES the ones that cannot run at once on a real host. The implication runs one way only: contending for a backend lock means sharing that backend’s ecosystem, so a lock family is always contained in a label group.

Never the reverse, and the gaps are the point: fink and opkg speak dpkg through databases of their own, zerobrew has its own prefix and dkp-pacman its own repositories, while pypi-based, npm-based and the plugin-manager groups share a registry or a host program rather than any lock at all. Asserting equality here would be asserting those four facts away.

Catches a manager wired into a lock family but forgotten in the label groups, which is what it caught for nala.

vcpkg is the one exemption: it shares Homebrew’s cmake, a toolchain rather than a package backend, so it joins that family from outside the homebrew group.

tests.test_pool.test_delegating_managers_share_their_target_lock()[source]¶

A manager delegating to another’s CLI serializes with it.

It runs that manager’s own binary against that manager’s own state.

The delegation is declared in the class body (Delegate), which makes this derivable rather than a list to keep in step: wiring a new delegate without a lock family fails here.

tests.test_pool.test_pacman_subclasses_share_the_pacman_lock()[source]¶

Every manager inheriting from Pacman serializes with that family.

Each drives pacman’s own database.

dkp-pacman is the sole exemption: devkitPro ships it to sit beside a distribution’s pacman with its own repositories and database, so it contends with nothing. Any other subclass missing from the family is the bug this catches, which is how the AUR helpers went unserialized through 7.6.1.

Inheritance is a sufficient signal, never a necessary one: pamac reaches the same libalpm through a bundled definition and is covered by the family without appearing here.

tests.test_pool.test_ebuild_based_managers_share_one_lock_family()[source]¶

The ebuild-based label group is one lock family.

Its managers record into the same database of installed packages of a Gentoo host, so two of them mutating at once would be two writers of that database.

tests.test_pool.test_cached_pool()[source]¶
tests.test_pool.test_maintained_managers(manager_id)[source]¶
tests.test_pool.test_supported_managers(manager_id)[source]¶
tests.test_pool.test_unsupported_managers(manager_id)[source]¶
tests.test_pool.test_manager_groups()[source]¶

Test relationships between manager groups.

tests.test_pool.DERIVED_EXTRA_OPTIONS = frozenset({'cooldown_policy'})¶

Extra options computed from another flag rather than declared as one.

cooldown_policy is resolved from the --cooldown union and the meta_package_manager.cooldown configuration (see meta_package_manager.cooldown.resolve_cooldown()): the manager-level attribute has no CLI flag of its own, only the per-manager override.

tests.test_pool.test_extra_option_allowlist()[source]¶
tests.test_pool.test_select_managers(kwargs, expected)[source]¶

Tuples everywhere check that select_managers() keeps the order.

tests.test_pool.test_select_managers_allow_empty_lets_an_empty_selection_through()[source]¶

No manager selected ends the run by default, and yields nothing on request.

tests.test_pool.test_select_managers_timeout_stamping()[source]¶

The user’s --timeout lands on every selected manager.

It does so even when unavailable ones are kept (mpm managers), whose version probes fire lazily at rendering time, after selection: an unstamped instance would fall back to the read-only default and let a wedged binary hold each table row for 120 seconds. A per-manager [mpm.overrides.<id>] override keeps precedence over the global option.

tests.test_pool.test_select_managers_cooldown_policy_keeps_precedence()[source]¶

A per-manager cooldown_policy override survives the global policy.

The override pins that manager’s enforcement posture, so the global policy resolved from --cooldown must not clobber it: [mpm.overrides.<id>] cooldown_policy = “best-effort” keeps running that one manager unguarded while the rest stay fail-closed.

tests.test_pool.test_warm_availability_skips_without_context()[source]¶

No active CLI context: leave probing to the lazy, sequential filter loop.

tests.test_pool.test_warm_availability_skips_when_not_concurrent(jobs, verbosity, count)[source]¶
tests.test_pool.test_warm_availability_probes_concurrently()[source]¶

With –jobs > 1 and several candidates, probes run off the main thread.

tests.test_pool.test_merge_into_probe_lanes_groups_by_signature()[source]¶

Managers whose probe may resolve to the same command share a lane.

tests.test_pool.test_merge_into_probe_lanes_partitions_the_whole_pool()[source]¶

Every manager lands on exactly one lane, whatever the pool grows to.

tests.test_pool.test_warm_availability_shares_one_cache_within_a_lane()[source]¶

A lane’s managers probe against one shared run_cache.

Each then gets its own value back: that dict is what collapses brew and cask both running brew --version into a single subprocess.