Skip to content

Commit

Permalink
✅ update the testcase test_group_edges_with_constrs
Browse files Browse the repository at this point in the history
  • Loading branch information
KafCoppelia committed Dec 2, 2024
1 parent 52c5231 commit 3298c55
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/backend/test_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down

0 comments on commit 3298c55

Please sign in to comment.