Skip to content

Commit 7b94894

Browse files
committed
use explicit naming for constant folding tests in TestTransforms
1 parent 9a42166 commit 7b94894

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/test_peepholer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def test_pack_unpack(self):
150150
self.assertNotInBytecode(code, 'UNPACK_SEQUENCE')
151151
self.check_lnotab(code)
152152

153-
def test_folding_of_tuples_of_constants(self):
153+
def test_constant_folding_tuples_of_constants(self):
154154
for line, elem in (
155155
('a = 1,2,3', (1, 2, 3)),
156156
('("a","b","c")', ('a', 'b', 'c')),
@@ -191,7 +191,7 @@ def crater():
191191
],)
192192
self.check_lnotab(crater)
193193

194-
def test_folding_of_lists_of_constants(self):
194+
def test_constant_folding_lists_of_constants(self):
195195
for line, elem in (
196196
# in/not in constants with BUILD_LIST should be folded to a tuple:
197197
('a in [1,2,3]', (1, 2, 3)),
@@ -205,7 +205,7 @@ def test_folding_of_lists_of_constants(self):
205205
self.assertNotInBytecode(code, 'BUILD_LIST')
206206
self.check_lnotab(code)
207207

208-
def test_folding_of_sets_of_constants(self):
208+
def test_constant_folding_sets_of_constants(self):
209209
for line, elem in (
210210
# in/not in constants with BUILD_SET should be folded to a frozenset:
211211
('a in {1,2,3}', frozenset({1, 2, 3})),
@@ -383,7 +383,7 @@ def test_constant_folding_small_int(self):
383383
self.assertNotInBytecode(code, 'LOAD_SMALL_INT')
384384
self.check_lnotab(code)
385385

386-
def test_folding_unaryop(self):
386+
def test_constant_folding_unaryop(self):
387387
intrinsic_positive = 5
388388
tests = [
389389
('-0', 'UNARY_NEGATIVE', None, True, 'LOAD_SMALL_INT', 0),
@@ -427,7 +427,7 @@ def negzero():
427427
self.assertFalse(instr.opname.startswith('UNARY_'))
428428
self.check_lnotab(negzero)
429429

430-
def test_folding_binop(self):
430+
def test_constant_folding_binop(self):
431431
tests = [
432432
('1 + 2', 'NB_ADD', True, 'LOAD_SMALL_INT', 3),
433433
('1 + 2 + 3', 'NB_ADD', True, 'LOAD_SMALL_INT', 6),

0 commit comments

Comments
 (0)