From: Stefan Behnel Date: Sun, 11 Aug 2013 15:27:08 +0000 (+0200) Subject: extract normal cythonize script test from package compilation test as the latter... X-Git-Tag: 0.20b1~375 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dc9170862290cc6b502ec92ad84236ba8491669;p=platform%2Fupstream%2Fpython-cython.git 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 --- diff --git a/tests/build/cythonize_script.srctree b/tests/build/cythonize_script.srctree index fda090a..3d488f0 100644 --- a/tests/build/cythonize_script.srctree +++ b/tests/build/cythonize_script.srctree @@ -1,24 +1,26 @@ ''' -PYTHON -m Cython.Build.Cythonize -i pkg -PYTHON -c "import pkg.sub.test; assert pkg.sub.test.TEST == 'pkg.sub.test'; assert '.py' not in pkg.sub.test.__file__" +PYTHON -m Cython.Build.Cythonize -i '**/*_test.py' +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/test.py ######## +######## pkg/cy_test.py ######## -TEST = 'pkg.test' +TEST = 'pkg.cy_test' ######## pkg/sub/__init__.py ######## -######## pkg/sub/test.py ######## +######## pkg/sub/cy_test.py ######## # cython: language_level=3 -TEST = 'pkg.sub.test' +TEST = 'pkg.sub.cy_test' ustring = 'abc' diff --git a/tests/build/cythonize_script_package.srctree b/tests/build/cythonize_script_package.srctree new file mode 100644 index 0000000..79d2dc0 --- /dev/null +++ b/tests/build/cythonize_script_package.srctree @@ -0,0 +1,35 @@ +''' +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)