Commit 9dc91708 authored by Stefan Behnel's avatar Stefan Behnel

extract normal cythonize script test from package compilation test as the...

extract normal cythonize script test from package compilation test as the latter is not supported in Py3.[012]

--HG--
rename : tests/build/cythonize_script.srctree => tests/build/cythonize_script_package.srctree
parent 92b91f9a
''' '''
PYTHON -m Cython.Build.Cythonize -i pkg PYTHON -m Cython.Build.Cythonize -i '**/*_test.py'
PYTHON -c "import pkg.sub.test; assert pkg.sub.test.TEST == 'pkg.sub.test'; assert '.py' not in pkg.sub.test.__file__" PYTHON -c "import cy_test; assert cy_test.TEST == 'cy_test', cy_test.TEST; assert '.py' not in cy_test.__file__, cy_test.__file__"
PYTHON -c "import pkg.cy_test; assert pkg.cy_test.TEST == 'pkg.cy_test', pkg.cy_test.TEST; assert '.py' not in pkg.cy_test.__file__, pkg.cy_test.__file__"
PYTHON -c "import pkg.sub.cy_test; assert pkg.sub.cy_test.TEST == 'pkg.sub.cy_test', pkg.sub.cy_test.TEST; assert '.py' not in pkg.sub.cy_test.__file__, pkg.cy_test.__file__"
''' '''
######## test.py ######## ######## cy_test.py ########
TEST = 'test' TEST = 'cy_test'
######## pkg/__init__.py ######## ######## pkg/__init__.py ########
######## pkg/test.py ######## ######## pkg/cy_test.py ########
TEST = 'pkg.test' TEST = 'pkg.cy_test'
######## pkg/sub/__init__.py ######## ######## pkg/sub/__init__.py ########
######## pkg/sub/test.py ######## ######## pkg/sub/cy_test.py ########
# cython: language_level=3 # cython: language_level=3
TEST = 'pkg.sub.test' TEST = 'pkg.sub.cy_test'
ustring = 'abc' ustring = 'abc'
......
'''
PYTHON -m Cython.Build.Cythonize -i pkg
PYTHON package_test.py
'''
######## package_test.py ########
import sys
if sys.version_info[0] < 3 or sys.version_info >= (3,3):
# __init__.py compilation isn't supported in Py 3.[012]
import pkg.sub.test
assert pkg.sub.test.TEST == 'pkg.sub.test'
assert '.py' not in pkg.sub.test.__file__
######## test.py ########
TEST = 'test'
######## pkg/__init__.py ########
######## pkg/test.py ########
TEST = 'pkg.test'
######## pkg/sub/__init__.py ########
######## pkg/sub/test.py ########
# cython: language_level=3
TEST = 'pkg.sub.test'
ustring = 'abc'
assert isinstance(ustring, unicode)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment