[Zope-dev] Bootstrapping ZCA for Python 3.

Wolfgang Schnerring ws at gocept.com
Mon Dec 7 02:27:35 EST 2009


* Lennart Regebro <lregebro at jarn.com> [2009-12-06 21:14]:
> Time had therefore come to zope.testing. Why
> zope.testing? Because most components in zope.* uses zc.buildout, and
> zc.buildouts tests uses zope.testing. But of course we here have a
> bootstrapping problem, zope.testing of course also uses buildout.

When I worked on py3 stuff on the DZUG sprint in September, we broke out
of that catch-22 by porting zope.testing first, and running its test
using <http://pypi.python.org/pypi/discover>, patched[1] to pick up
tests via the test_suite() methods. That way we could run the tests of
zope.testing under py3 without needing zope.testing itself or
zc.buildout to do so, so porting zope.testing could be tackled.

Our work from then is on the regebro-python3 branch (which might be
familiar ;-). I don't quite remember how far we've come. I *think* most
of the porting work is done and we were last working on integrating
Distribute/2to3 into the setup.py, but got hung up on the Distribute
side of things.

Wolfgang

[1]
@@ -54,9 +54,12 @@
             if isinstance(obj, type) and issubclass(obj, unittest.TestCase):
                 tests.append(self.loadTestsFromTestCase(obj))
 
-        load_tests = getattr(module, 'load_tests', None)
+        load_tests = getattr(module, 'test_suite', None)
         if use_load_tests and load_tests is not None:
-            return load_tests(self, tests, None)
+            tests = load_tests()
+            if not tests:
+                return lambda x: None
+            return tests
         return self.suiteClass(tests)



More information about the Zope-Dev mailing list