Skip to content

Commit ceaf091

Browse files
committed
Remove unit test
- `v is 1` is not recommended in Python
1 parent 222c3a7 commit ceaf091

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3578,25 +3578,6 @@ def return_false():
35783578
# v + 1 should be constant folded
35793579
self.assertNotIn("_BINARY_OP", uops)
35803580

3581-
def test_is_number_narrows_to_constant(self):
3582-
def f(n):
3583-
def return_1():
3584-
return 1
3585-
3586-
hits = 0
3587-
v = return_1()
3588-
for i in range(n):
3589-
if v is 1:
3590-
hits += v + 1
3591-
return hits
3592-
3593-
res, ex = self._run_with_optimizer(f, TIER2_THRESHOLD)
3594-
self.assertEqual(res, TIER2_THRESHOLD * 2)
3595-
self.assertIsNotNone(ex)
3596-
3597-
# v + 1 should be constant folded
3598-
self.assertLessEqual(count_ops(ex, "_BINARY_OP_ADD_INT"), 1)
3599-
36003581
def test_for_iter_gen_frame(self):
36013582
def f(n):
36023583
for i in range(n):

0 commit comments

Comments
 (0)