portfolio-optimiser/tests/test_imports_core.py

23 lines
1.1 KiB
Python

"""Step 1 import smoke (core deps): the GA orchestration builders + the PuLP solver are
now MVP-runtime dependencies (promoted from ``dev`` into ``[project.dependencies]``), and
PuLP's bundled CBC solver is available on this platform.
Pattern: tests/spikes/test_imports.py (plain functions, no fixtures).
"""
import warnings
def test_core_runtime_deps_importable_and_cbc_available() -> None:
# Promoted from [dev] to [project.dependencies] in Fase 2 — now MVP-runtime, not dev-only.
from agent_framework.orchestrations import GroupChatBuilder # noqa: F401
import pulp
# CBC ships in PuLP's wheel; the deterministic validator hard-depends on it (no silent
# LP-relaxation fallback). PULP_CBC_CMD is the only handle to the bundled binary
# (PuLP 4.0 will require pulp[cbc] + COIN_CMD — a future migration note).
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
# PuLP 3.3.2's available() returns the resolved CBC binary PATH (a truthy str) when
# present, not the bool True — so assert truthiness, not identity.
assert pulp.PULP_CBC_CMD(msg=False).available()