import os
-from Cython.Debugger import DebugWriter
from Cython.Compiler import CmdLine
from Cython.TestUtils import TransformTest
from Cython.Compiler.ParseTreeTransforms import *
from Cython.Compiler.Nodes import *
-from Cython.Debugger.Tests import TestLibCython
+
class TestNormalizeTree(TransformTest):
def test_parserbehaviour_is_what_we_coded_for(self):
""", t)
-
-class TestDebugTransform(TestLibCython.DebuggerTestCase):
+
+if sys.version_info[:2] > (2, 4):
+ from Cython.Debugger import DebugWriter
+ from Cython.Debugger.Tests.TestLibCython import DebuggerTestCase
+else:
+ # skip test, don't let it inherit unittest.TestCase
+ DebuggerTestCase = object
+
+class TestDebugTransform(DebuggerTestCase):
def elem_hasattrs(self, elem, attrs):
# we shall supporteth python 2.3 !
raise
+
+
+
if __name__ == "__main__":
import unittest
unittest.main()
except Exception:
pass
+include_debugger = sys.version_info[:2] > (2, 4)
+
def collect_unittests(path, module_prefix, suite, selectors):
def file_matches(filename):
return filename.startswith("Test") and filename.endswith(".py")
return dirname == "Tests"
loader = unittest.TestLoader()
-
- skipped_dirs = []
+
+ if include_debugger:
+ skipped_dirs = []
+ else:
+ cython_dir = os.path.dirname(os.path.abspath(__file__))
+ skipped_dirs = [os.path.join(cython_dir, 'Cython', 'Debugger')]
for dirpath, dirnames, filenames in os.walk(path):
if dirpath != path and "__init__.py" not in filenames:
module = getattr(module, x)
suite.addTests([loader.loadTestsFromModule(module)])
+
+
def collect_doctests(path, module_prefix, suite, selectors):
def package_matches(dirname):
+ if dirname == 'Debugger' and not include_debugger:
+ return False
return dirname not in ("Mac", "Distutils", "Plex")
def file_matches(filename):
filename, ext = os.path.splitext(filename)
- blacklist = ('libcython', 'libpython', 'test_libcython_in_gdb')
+ blacklist = ['libcython', 'libpython', 'test_libcython_in_gdb',
+ 'TestLibCython']
return (ext == '.py' and not
'~' in filename and not
'#' in filename and not