Ronald Oussoren avatar Ronald Oussoren committed 00ba676

Small tweaks to make it possible to test with python 2.5

(Patch is likely incomplete as my 2.5 install doesn't have unittest2 yet
and I don't have internet access right now)

Comments (0)

Files changed (2)


+if sys.version_info[0] == 2:
+    def B(value):
+        return value
+    def B(value):
+        return value.encode('latin1')
 class TestBasicApp (unittest.TestCase):
     py2app_args = []
         ln = p.stdout.readline()
-        self.assertEqual(ln.strip(), b"os")
+        self.assertEqual(ln.strip(), B("os"))
         # Dependency of the main module:
         ln = p.stdout.readline()
-        self.assertEqual(ln.strip(), b"decimal")
+        self.assertEqual(ln.strip(), B("decimal"))
         if '--alias' not in self.py2app_args:
             # Not a dependency of the module (stdlib):
     extra_args = dict()
+if sys.version_info[0] == 3 or (sys.version_info[:2] >= (2,7)):
+    tests_require = []
+    tests_require = ['unittest2']
 def test_loader():
     import unittest
             module = __import__(modName)
         except ImportError:
-            print ("SKIP %s: %s"%(modName, sys.exc_info[1]))
+            print ("SKIP %s: %s"%(modName, sys.exc_info()[1]))
         s = unittest.defaultTestLoader.loadTestsFromModule(module)
+    tests_require=tests_require,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.