Skip to content

Commit ba650bf

Browse files
rapsealkclaude
andcommitted
test(agent): Drop redundant fixture attrs and case_id column
- Remove unused local_config + _docker mock from the NUMA-locality cpu_plugin fixture: CPUPlugin.generate_docker_args doesn't read them. - Replace the case_id parametrize column with pytest's `ids=` kwarg; pytest already labels failures via the parametrize id. Refs #11217 Refs #11222 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0eda461 commit ba650bf

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

tests/unit/agent/test_docker_intrinsic.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,7 @@ class TestCPUPluginGenerateDockerArgsNumaLocality:
619619

620620
@pytest.fixture
621621
def cpu_plugin(self) -> CPUPlugin:
622-
plugin = CPUPlugin.__new__(CPUPlugin)
623-
plugin.local_config = {"agent": {"docker-mode": "default"}}
624-
plugin._docker = AsyncMock()
625-
return plugin
622+
return CPUPlugin.__new__(CPUPlugin)
626623

627624
@staticmethod
628625
def _device_alloc(core_ids: list[int]) -> dict[SlotName, dict[DeviceId, Decimal]]:
@@ -694,17 +691,17 @@ async def test_multi_node_allocation_omits_cpuset_mems(
694691
assert host_config["CpusetCpus"] == "0,2"
695692

696693
@pytest.mark.parametrize(
697-
("core_to_node", "case_id"),
694+
"core_to_node",
698695
[
699-
({0: 0}, "unknown_node"),
700-
({0: 0, 1: -1}, "negative_node"),
696+
{0: 0},
697+
{0: 0, 1: -1},
701698
],
699+
ids=["unknown_node", "negative_node"],
702700
)
703701
async def test_unknown_or_negative_node_omits_cpuset_mems(
704702
self,
705703
cpu_plugin: CPUPlugin,
706704
core_to_node: dict[int, int],
707-
case_id: str,
708705
) -> None:
709706
"""When any allocated core maps to an unknown (libnuma returns -1) or
710707
explicitly negative NUMA node, CpusetMems must be omitted.
@@ -721,7 +718,7 @@ async def test_unknown_or_negative_node_omits_cpuset_mems(
721718
)
722719

723720
host_config = result["HostConfig"]
724-
assert "CpusetMems" not in host_config, f"case={case_id}"
721+
assert "CpusetMems" not in host_config
725722
# Sanity: core-list plumbing still works.
726723
assert host_config["Cpus"] == 2
727724
assert host_config["CpusetCpus"] == "0,1"

0 commit comments

Comments
 (0)