X Tutup
Skip to content

Commit 4aa703d

Browse files
committed
Test optimized Python code and Python 3.2
1 parent f3a4e6e commit 4aa703d

File tree

9 files changed

+28
-8
lines changed

9 files changed

+28
-8
lines changed

test/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ check-native-short:
8787
check-2.7-ok:
8888
$(PYTHON) test_pythonlib.py --ok-2.7 --verify $(COMPILE)
8989

90-
#: Run longer Python 2.7's lib files known to be okay
90+
#: Run longer Python 3.2's lib files known to be okay
91+
check-3.2-ok:
92+
$(PYTHON) test_pythonlib.py --ok-3.2 --verify $(COMPILE)
93+
94+
#: Run longer Python 3.4's lib files known to be okay
9195
check-3.4-ok:
9296
$(PYTHON) test_pythonlib.py --ok-3.4 --verify $(COMPILE)
9397

test/bytecode_3.5/06_classbug.pyc

513 Bytes
Binary file not shown.

test/ok_lib2.7/_abcoll.pyc

27.8 KB
Binary file not shown.

test/ok_lib2.7/_abcoll.pyo

27.8 KB
Binary file not shown.

test/ok_lib2.7/antigravity.pyo

245 Bytes
Binary file not shown.
1.03 KB
Binary file not shown.
1.03 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Python 3.2 Bug from abc.py
2+
3+
# Make sure we handle:
4+
5+
# LOAD_FAST '__locals__'
6+
# STORE_LOCALS ''
7+
8+
class abstractclassmethod(object):
9+
"""A Python 3.2 STORE_LOCALS bug
10+
"""
11+
12+
def __init__(self, callable):
13+
callable.__isabstractmethod__ = True

test/test_pythonlib.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,28 @@ def get_srcdir():
5555
PYOC = ('*.pyc', '*.pyo')
5656

5757
test_options = {
58-
# name: (src_basedir, pattern, output_base_suffix, pythoin_version)
58+
# name: (src_basedir, pattern, output_base_suffix, python_version)
5959
'test':
6060
('test', PYC, 'test'),
6161

6262
'ok-2.6':
6363
(os.path.join(src_dir, 'ok_2.6'),
64-
PYC, 'ok-2.6', 2.6),
64+
PYOC, 'ok-2.6', 2.6),
6565

6666
'ok-2.7': (os.path.join(src_dir, 'ok_lib2.7'),
67-
PYC, 'ok-2.7', 2.7),
67+
PYOC, 'ok-2.7', 2.7),
68+
69+
'ok-3.2': (os.path.join(src_dir, 'ok_lib3.2'),
70+
PYOC, 'ok-3.2', 3.5),
6871

6972
'base-2.7': (os.path.join(src_dir, 'base_tests', 'python2.7'),
70-
PYC, 'base_2.7', 2.7),
73+
PYOC, 'base_2.7', 2.7),
7174
}
7275

73-
for vers in (2.7, 3.4):
76+
for vers in (2.7, 3.4, 3.5):
7477
pythonlib = "ok_lib%s" % vers
7578
key = "ok-%s" % vers
76-
test_options[key] = (os.path.join(src_dir, pythonlib), PYC, key, vers)
79+
test_options[key] = (os.path.join(src_dir, pythonlib), PYOC, key, vers)
7780
pass
7881

7982
for vers in (2.5, 2.6, 2.7, 3.2, 3.3, 3.4, 3.5):
@@ -84,7 +87,7 @@ def get_srcdir():
8487
pythonlib = "python%s" % vers
8588
if vers >= 3.0:
8689
pythonlib = os.path.join(pythonlib, '__pycache__')
87-
test_options[key] = (os.path.join(lib_prefix, pythonlib), PYC, pythonlib, vers)
90+
test_options[key] = (os.path.join(lib_prefix, pythonlib), PYOC, pythonlib, vers)
8891

8992
#-----
9093

0 commit comments

Comments
 (0)
X Tutup