Skip to content

Commit 695a928

Browse files
committed
Update test_peepholer.py to reflect the new changes made to flowgraph.c
1 parent 2f0ffdd commit 695a928

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

Lib/test/test_peepholer.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,14 +2430,14 @@ def test_optimized(self):
24302430
]
24312431
self.check(insts, expected)
24322432

2433-
def test_optimize_unconsumed_when_is_safe(self):
2433+
def test_unoptimized_if_unconsumed(self):
24342434
insts = [
24352435
("LOAD_FAST", 0, 1),
24362436
("LOAD_FAST", 1, 2),
24372437
("POP_TOP", None, 3),
24382438
]
24392439
expected = [
2440-
("LOAD_FAST_BORROW", 0, 1),
2440+
("LOAD_FAST", 0, 1),
24412441
("LOAD_FAST_BORROW", 1, 2),
24422442
("POP_TOP", None, 3),
24432443
]
@@ -2449,7 +2449,7 @@ def test_optimize_unconsumed_when_is_safe(self):
24492449
("POP_TOP", None, 3),
24502450
]
24512451
expected = [
2452-
("LOAD_FAST_BORROW", 0, 1),
2452+
("LOAD_FAST", 0, 1),
24532453
("NOP", None, 2),
24542454
("NOP", None, 3),
24552455
]
@@ -2509,12 +2509,7 @@ def test_consume_some_inputs_no_outputs(self):
25092509
("GET_LEN", None, 2),
25102510
("LIST_APPEND", 0, 3),
25112511
]
2512-
expected = [
2513-
("LOAD_FAST_BORROW", 0, 1),
2514-
("GET_LEN", None, 2),
2515-
("LIST_APPEND", 0, 3),
2516-
]
2517-
self.check(insts, expected)
2512+
self.check(insts, insts)
25182513

25192514
def test_check_exc_match(self):
25202515
insts = [
@@ -2523,7 +2518,7 @@ def test_check_exc_match(self):
25232518
("CHECK_EXC_MATCH", None, 3)
25242519
]
25252520
expected = [
2526-
("LOAD_FAST_BORROW", 0, 1),
2521+
("LOAD_FAST", 0, 1),
25272522
("LOAD_FAST_BORROW", 1, 2),
25282523
("CHECK_EXC_MATCH", None, 3)
25292524
]
@@ -2573,7 +2568,7 @@ def test_load_attr(self):
25732568
("LOAD_ATTR", 1, 2),
25742569
]
25752570
expected = [
2576-
("LOAD_FAST_BORROW", 0, 1),
2571+
("LOAD_FAST", 0, 1),
25772572
("LOAD_ATTR", 1, 2),
25782573
]
25792574
self.check(insts, expected)
@@ -2603,7 +2598,7 @@ def test_super_attr(self):
26032598
expected = [
26042599
("LOAD_FAST_BORROW", 0, 1),
26052600
("LOAD_FAST_BORROW", 1, 2),
2606-
("LOAD_FAST_BORROW", 2, 3),
2601+
("LOAD_FAST", 2, 3),
26072602
("LOAD_SUPER_ATTR", 1, 4),
26082603
]
26092604
self.check(insts, expected)

0 commit comments

Comments
 (0)