From 8d722fafad601a1224e184d91e6e2a26b4955740 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 4 Nov 2010 23:53:42 -0700 Subject: [PATCH] Fix doctests. --- Cython/Build/Inline.py | 1 + runtests.py | 5 ++++- tests/build/basic_cythonize.srctree | 2 +- tests/build/inline_distutils.srctree | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cython/Build/Inline.py b/Cython/Build/Inline.py index b1ab529d..38080b8c 100644 --- a/Cython/Build/Inline.py +++ b/Cython/Build/Inline.py @@ -1,3 +1,4 @@ +#no doctest print "Warning: Using prototype cython.inline code..." import tempfile diff --git a/runtests.py b/runtests.py index 8de9b204..b8eec3ad 100644 --- a/runtests.py +++ b/runtests.py @@ -655,7 +655,10 @@ def collect_doctests(path, module_prefix, suite, selectors): for f in filenames: if file_matches(f): if not f.endswith('.py'): continue - filepath = os.path.join(dirpath, f)[:-len(".py")] + filepath = os.path.join(dirpath, f) + if os.path.getsize(filepath) == 0: continue + if 'no doctest' in open(filepath).next(): continue + filepath = filepath[:-len(".py")] modulename = module_prefix + filepath[len(path)+1:].replace(os.path.sep, '.') if not [ 1 for match in selectors if match(modulename) ]: continue diff --git a/tests/build/basic_cythonize.srctree b/tests/build/basic_cythonize.srctree index 3e6b4029..25932a20 100644 --- a/tests/build/basic_cythonize.srctree +++ b/tests/build/basic_cythonize.srctree @@ -5,7 +5,7 @@ PYTHON -c "import a" # TODO: Better interface... -from Cython.Compiler.Dependencies import cythonize +from Cython.Build.Dependencies import cythonize from distutils.core import setup diff --git a/tests/build/inline_distutils.srctree b/tests/build/inline_distutils.srctree index 70f2bb47..7ff3859b 100644 --- a/tests/build/inline_distutils.srctree +++ b/tests/build/inline_distutils.srctree @@ -5,7 +5,7 @@ PYTHON -c "import a" # TODO: Better interface... -from Cython.Compiler.Dependencies import cythonize +from Cython.Build.Dependencies import cythonize from distutils.core import setup -- 2.26.2