From 9dc9170862290cc6b502ec92ad84236ba8491669 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 11 Aug 2013 17:27:08 +0200 Subject: [PATCH] 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 --- tests/build/cythonize_script.srctree | 18 +++++++------- tests/build/cythonize_script_package.srctree | 35 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 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) -- 2.7.4