Fix Python 3 testrunner and give a warning for Python 2 builds without debug symbols
authorMark Florisson <markflorisson88@gmail.com>
Tue, 18 Jan 2011 19:31:35 +0000 (20:31 +0100)
committerMark Florisson <markflorisson88@gmail.com>
Tue, 18 Jan 2011 19:31:35 +0000 (20:31 +0100)
Cython/Debugger/Tests/TestLibCython.py
Cython/Debugger/Tests/test_libcython_in_gdb.py
runtests.py

index 8bc123a0559ee7be44b2136bac462059f12974b8..436085c159eb89e7a16f16dcc0a8508905a90127 100644 (file)
@@ -197,10 +197,11 @@ class TestAll(GdbDebuggerTestCase):
             return
 
         out, err = self.p.communicate()
+        err = err.decode('UTF-8')
         border = '*' * 30
         start = '%s   v INSIDE GDB v   %s' % (border, border)
         end   = '%s   ^ INSIDE GDB ^   %s' % (border, border)
-        errmsg = '\n%s\n%s%s' % (start, err.decode('UTF-8'), end)
+        errmsg = '\n%s\n%s%s' % (start, err, end)
         self.assertEquals(0, self.p.wait(), errmsg)
         sys.stderr.write(err)
 
index b6d29022a5269e86ba2d3d56283a7be4bcafa72f..79de18581401cc9fa11deb33f6e527c7e97bd33b 100644 (file)
@@ -426,7 +426,7 @@ def run_unittest_in_module(modulename):
                 "debugging information. Either compile python with "
                 "-g or get a debug build (configure with --with-pydebug).")
         warnings.warn(msg)
-        os._exit(1)
+        os._exit(0)
     else:
         m = __import__(modulename, fromlist=[''])
         tests = inspect.getmembers(m, inspect.isclass)
index 67a069327b6e001eee0fcd583b3efc678f2bf046..0d805bfe58fd503669869497b06ee0170d758e85 100644 (file)
@@ -78,6 +78,15 @@ VER_DEP_MODULES = {
                                         'run.special_methods_T561_py2']),
 }
 
+# files that should not be converted to Python 3 code with 2to3
+KEEP_2X_FILES = [
+    os.path.join('Cython', 'Debugger', 'Tests', 'test_libcython_in_gdb.py'),
+    os.path.join('Cython', 'Debugger', 'Tests', 'test_libpython_in_gdb.py'),
+    os.path.join('Cython', 'Debugger', 'libcython.py'),
+    os.path.join('Cython', 'Debugger', 'libpython.py'),
+]
+
+
 INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
 CFLAGS = os.getenv('CFLAGS', '').split()
 
@@ -932,9 +941,14 @@ def refactor_for_py3(distdir, cy3_dir):
                      recursive-exclude Cython *
                      recursive-include Cython *.py *.pyx *.pxd
                      recursive-include Cython/Debugger/Tests *
+                     include runtests.py
                      ''')
     sys.path.insert(0, cy3_dir)
 
+    for keep_2x_file in KEEP_2X_FILES:
+        destfile = os.path.join(cy3_dir, keep_2x_file)
+        shutil.copy(keep_2x_file, destfile)
+
 class PendingThreadsError(RuntimeError):
     pass