From 3298c5512f21d3a59ef5546ec24e7bef63f55974 Mon Sep 17 00:00:00 2001 From: KafCoppelia Date: Mon, 2 Dec 2024 10:19:04 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20update=20the=20testcase=20`test=5Fg?= =?UTF-8?q?roup=5Fedges=5Fwith=5Fconstrs`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/backend/test_graphs.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/backend/test_graphs.py b/tests/backend/test_graphs.py index 6d3de2f0..9491ee0b 100644 --- a/tests/backend/test_graphs.py +++ b/tests/backend/test_graphs.py @@ -467,14 +467,18 @@ def test_group_edges_with_constrs( # In this case, N2 & N3 should be together. pos_n2 = pos_n3 = 0 for i, cb in enumerate(mapper.core_blocks): - _g_with_name = [e.name for e in cb._parents] + _g_with_name = [e.name for e in cb.obj] if "s2" in _g_with_name: pos_n2 = i + break + + for i, cb in enumerate(mapper.core_blocks): + _g_with_name = [e.name for e in cb.obj] if "s3" in _g_with_name: pos_n3 = i + break assert pos_n2 == pos_n3 - assert pos_n2 != 0 # In this case, N2 & N3 should be split. monkeypatch.setattr(net.n2, "_tws", 2) @@ -486,11 +490,16 @@ def test_group_edges_with_constrs( pos_n2 = pos_n3 = 0 for i, part in enumerate(mapper.core_blocks): - _g_with_name = [e.name for e in part._parents] + _g_with_name = [e.name for e in part.obj] if "s2" in _g_with_name: pos_n2 = i + break + + for i, part in enumerate(mapper.core_blocks): + _g_with_name = [e.name for e in part.obj] if "s3" in _g_with_name: pos_n3 = i + break assert pos_n2 != pos_n3