Skip to content

Commit 7dfb94c

Browse files
committed
Fix existing uops tests
1 parent a9c0805 commit 7dfb94c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Lib/test/test_capi/test_misc.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,7 @@ def testfunc(x):
24552455
opt = _testinternalcapi.get_uop_optimizer()
24562456

24572457
with temporary_optimizer(opt):
2458-
testfunc(10)
2458+
testfunc(20)
24592459

24602460
ex = get_first_executor(testfunc)
24612461
self.assertIsNotNone(ex)
@@ -2470,7 +2470,7 @@ def testfunc(n):
24702470

24712471
opt = _testinternalcapi.get_uop_optimizer()
24722472
with temporary_optimizer(opt):
2473-
testfunc(10)
2473+
testfunc(20)
24742474

24752475
ex = get_first_executor(testfunc)
24762476
self.assertIsNotNone(ex)
@@ -2485,7 +2485,7 @@ def testfunc(a):
24852485

24862486
opt = _testinternalcapi.get_uop_optimizer()
24872487
with temporary_optimizer(opt):
2488-
testfunc(range(10))
2488+
testfunc(range(20))
24892489

24902490
ex = get_first_executor(testfunc)
24912491
self.assertIsNotNone(ex)
@@ -2495,12 +2495,13 @@ def testfunc(a):
24952495
def test_pop_jump_if_not_none(self):
24962496
def testfunc(a):
24972497
for x in a:
2498+
x = None
24982499
if x is not None:
24992500
x = 0
25002501

25012502
opt = _testinternalcapi.get_uop_optimizer()
25022503
with temporary_optimizer(opt):
2503-
testfunc(range(10))
2504+
testfunc(range(20))
25042505

25052506
ex = get_first_executor(testfunc)
25062507
self.assertIsNotNone(ex)
@@ -2515,7 +2516,7 @@ def testfunc(n):
25152516

25162517
opt = _testinternalcapi.get_uop_optimizer()
25172518
with temporary_optimizer(opt):
2518-
testfunc(10)
2519+
testfunc(20)
25192520

25202521
ex = get_first_executor(testfunc)
25212522
self.assertIsNotNone(ex)
@@ -2530,7 +2531,7 @@ def testfunc(n):
25302531

25312532
opt = _testinternalcapi.get_uop_optimizer()
25322533
with temporary_optimizer(opt):
2533-
testfunc(10)
2534+
testfunc(20)
25342535

25352536
ex = get_first_executor(testfunc)
25362537
self.assertIsNotNone(ex)
@@ -2550,7 +2551,7 @@ def testfunc(n):
25502551

25512552
opt = _testinternalcapi.get_uop_optimizer()
25522553
with temporary_optimizer(opt):
2553-
testfunc(10)
2554+
testfunc(20)
25542555

25552556
ex = get_first_executor(testfunc)
25562557
self.assertIsNotNone(ex)
@@ -2568,8 +2569,8 @@ def testfunc(n):
25682569

25692570
opt = _testinternalcapi.get_uop_optimizer()
25702571
with temporary_optimizer(opt):
2571-
total = testfunc(10)
2572-
self.assertEqual(total, 45)
2572+
total = testfunc(20)
2573+
self.assertEqual(total, 190)
25732574

25742575
ex = get_first_executor(testfunc)
25752576
self.assertIsNotNone(ex)
@@ -2589,9 +2590,9 @@ def testfunc(a):
25892590

25902591
opt = _testinternalcapi.get_uop_optimizer()
25912592
with temporary_optimizer(opt):
2592-
a = list(range(10))
2593+
a = list(range(20))
25932594
total = testfunc(a)
2594-
self.assertEqual(total, 45)
2595+
self.assertEqual(total, 190)
25952596

25962597
ex = get_first_executor(testfunc)
25972598
self.assertIsNotNone(ex)
@@ -2611,9 +2612,9 @@ def testfunc(a):
26112612

26122613
opt = _testinternalcapi.get_uop_optimizer()
26132614
with temporary_optimizer(opt):
2614-
a = tuple(range(10))
2615+
a = tuple(range(20))
26152616
total = testfunc(a)
2616-
self.assertEqual(total, 45)
2617+
self.assertEqual(total, 190)
26172618

26182619
ex = get_first_executor(testfunc)
26192620
self.assertIsNotNone(ex)
@@ -2647,7 +2648,7 @@ def dummy(x):
26472648

26482649
opt = _testinternalcapi.get_uop_optimizer()
26492650
with temporary_optimizer(opt):
2650-
testfunc(10)
2651+
testfunc(20)
26512652

26522653
ex = get_first_executor(testfunc)
26532654
self.assertIsNotNone(ex)
@@ -2656,6 +2657,5 @@ def dummy(x):
26562657
self.assertIn("_BINARY_OP_ADD_INT", uops)
26572658

26582659

2659-
26602660
if __name__ == "__main__":
26612661
unittest.main()

0 commit comments

Comments
 (0)