[Checkins] SVN: zc.recipe.testrunner/branches/gary-support-system-python/ make tests pass with my new zc.buildout branch and, with a bit more difficulty, zope.testing 3.7 and 3.8

Gary Poster gary.poster at canonical.com
Fri Sep 4 12:26:33 EDT 2009


Log message for revision 103550:
  make tests pass with my new zc.buildout branch and, with a bit more difficulty, zope.testing 3.7 and 3.8

Changed:
  _U  zc.recipe.testrunner/branches/gary-support-system-python/
  U   zc.recipe.testrunner/branches/gary-support-system-python/setup.py
  U   zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/README.txt
  U   zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/bugfixes.txt
  U   zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/tests.py

-=-

Property changes on: zc.recipe.testrunner/branches/gary-support-system-python
___________________________________________________________________
Modified: svn:externals
   - zc.buildout svn+ssh://svn.zope.org/repos/main/zc.buildout/branches/gary-support-system-python

   + zc.buildout svn+ssh://svn.zope.org/repos/main/zc.buildout/branches/gary-support-system-python-3


Modified: zc.recipe.testrunner/branches/gary-support-system-python/setup.py
===================================================================
--- zc.recipe.testrunner/branches/gary-support-system-python/setup.py	2009-09-04 15:29:36 UTC (rev 103549)
+++ zc.recipe.testrunner/branches/gary-support-system-python/setup.py	2009-09-04 16:26:32 UTC (rev 103550)
@@ -29,7 +29,7 @@
     include_package_data = True,
     package_dir = {'':'src'},
     namespace_packages = ['zc', 'zc.recipe'],
-    install_requires = ['zc.buildout >=1.4.0dev',
+    install_requires = ['zc.buildout >=1.5.0dev',
                         'zope.testing >=3.6.0',
                         'setuptools',
                         'zc.recipe.egg  >=1.3.0dev',

Modified: zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/README.txt
===================================================================
--- zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/README.txt	2009-09-04 15:29:36 UTC (rev 103549)
+++ zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/README.txt	2009-09-04 16:26:32 UTC (rev 103550)
@@ -236,17 +236,28 @@
     >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
 
     >>> cat(sample_buildout, 'bin', 'testdemo') # doctest: +ELLIPSIS
-    #!/usr/local/bin/python2.4
+    #!python
     <BLANKLINE>
+    import site
     import sys
     sys.path[:] = [
+        ...
+        ]
+    sys.path.extend([
         '/sample-buildout/demo',
-        '/sample-buildout/eggs/zope.testing-3.0-py2.3.egg',
-        '/sample-buildout/eggs/zope.interface-3.4.1-py2.4.egg',
-        '/sample-buildout/eggs/setuptools-0.6-py1.3.egg',
+        '/sample-buildout/eggs/zope.testing-X-pyN.N.egg',
+        '/sample-buildout/eggs/zope.interface-X-pyN.N.egg'...
+        '/sample-buildout/eggs/setuptools-X-pyN.N.egg'
+        ])
+    site_dirs = [
         '/usr/local/zope/lib/python',
         ...
         ]
+    # Add the site_dirs before `addsitedir` in case it has setuptools.
+    sys.path.extend(site_dirs)
+    # Process .pth files.
+    for p in site_dirs:
+        site.addsitedir(p)
     <BLANKLINE>
     import os
     sys.argv[0] = os.path.abspath(sys.argv[0])
@@ -280,17 +291,28 @@
     >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
 
     >>> cat(sample_buildout, 'bin', 'testdemo') # doctest: +ELLIPSIS
-    #!/usr/local/bin/python2.4
+    #!python
     <BLANKLINE>
+    import site
     import sys
     sys.path[:] = [
+        ...
+        ]
+    sys.path.extend([
         '/sample-buildout/demo',
-        '/sample-buildout/eggs/zope.testing-3.0-py2.3.egg',
-        '/sample-buildout/eggs/zope.interface-3.4.1-py2.4.egg',
-        '/sample-buildout/eggs/setuptools-0.6-py1.3.egg',
+        '/sample-buildout/eggs/zope.testing-X-pyN.N.egg',
+        '/sample-buildout/eggs/zope.interface-X-pyN.N.egg'...
+        '/sample-buildout/eggs/setuptools-X-pyN.N.egg'
+        ])
+    site_dirs = [
         '/usr/local/zope/lib/python',
         ...
         ]
+    # Add the site_dirs before `addsitedir` in case it has setuptools.
+    sys.path.extend(site_dirs)
+    # Process .pth files.
+    for p in site_dirs:
+        site.addsitedir(p)
     <BLANKLINE>
     import os
     sys.argv[0] = os.path.abspath(sys.argv[0])
@@ -336,17 +358,28 @@
     >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
 
     >>> cat(sample_buildout, 'bin', 'testdemo') # doctest: +ELLIPSIS
-    #!/usr/local/bin/python2.4
+    #!python
     <BLANKLINE>
+    import site
     import sys
     sys.path[:] = [
+        ...
+        ]
+    sys.path.extend([
         '/sample-buildout/demo',
-        '/sample-buildout/eggs/zope.testing-3.0-py2.4.egg',
-        '/sample-buildout/eggs/zope.interface-3.4.1-py2.4.egg',
-        '/sample-buildout/eggs/setuptools-0.6-py1.3.egg',
+        '/sample-buildout/eggs/zope.testing-X-pyN.N.egg',
+        '/sample-buildout/eggs/zope.interface-X-pyN.N.egg'...
+        '/sample-buildout/eggs/setuptools-X-pyN.N.egg'
+        ])
+    site_dirs = [
         '/usr/local/zope/lib/python',
         ...
         ]
+    # Add the site_dirs before `addsitedir` in case it has setuptools.
+    sys.path.extend(site_dirs)
+    # Process .pth files.
+    for p in site_dirs:
+        site.addsitedir(p)
     <BLANKLINE>
     import os
     sys.argv[0] = os.path.abspath(sys.argv[0])
@@ -434,16 +467,27 @@
     >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
 
     >>> cat(sample_buildout, 'bin', 'testdemo') # doctest: +ELLIPSIS
-    #!/usr/local/bin/python2.4
+    #!python
     <BLANKLINE>
+    import site
     import sys
     sys.path[:] = [
+        ...
+        ]
+    sys.path.extend([
         '/sample-buildout/demo',
-        '/sample-buildout/eggs/zope.testing-3.0-py2.3.egg',
-        '/sample-buildout/eggs/zope.interface-3.4.1-py2.4.egg',
-        '/sample-buildout/eggs/setuptools-0.6-py1.3.egg',
+        '/sample-buildout/eggs/zope.testing-X-pyN.N.egg',
+        '/sample-buildout/eggs/zope.interface-X-pyN.N.egg'...
+        '/sample-buildout/eggs/setuptools-X-pyN.N.egg'
+        ])
+    site_dirs = [
         ...
         ]
+    # Add the site_dirs before `addsitedir` in case it has setuptools.
+    sys.path.extend(site_dirs)
+    # Process .pth files.
+    for p in site_dirs:
+        site.addsitedir(p)
     <BLANKLINE>
     import os
     sys.argv[0] = os.path.abspath(sys.argv[0])
@@ -457,7 +501,6 @@
         zope.testing.testrunner.run([
             '--test-path', '/sample-buildout/demo',
             ])
-
     >>> print system(os.path.join(sample_buildout, 'bin', 'testdemo') + ' -vv'),
     Running tests at level 1
     Running zope.testing.testrunner.layer.UnitTests tests:
@@ -491,17 +534,28 @@
     >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
 
     >>> cat(sample_buildout, 'bin', 'testdemo') # doctest: +ELLIPSIS
-    #!/usr/local/bin/python2.4
+    #!python
     <BLANKLINE>
+    import site
     import sys
     sys.path[:] = [
+        ...
+        ]
+    sys.path.extend([
         '/sample-buildout/demo',
-        '/sample-buildout/eggs/zope.testing-3.0-py2.3.egg',
-        '/sample-buildout/eggs/zope.interface-3.4.1-py2.4.egg',
-        '/sample-buildout/eggs/setuptools-0.6-py1.3.egg',
+        '/sample-buildout/eggs/zope.testing-X-pyN.N.egg',
+        '/sample-buildout/eggs/zope.interface-X-pyN.N.egg'...
+        '/sample-buildout/eggs/setuptools-X-pyN.N.egg'
+        ])
+    site_dirs = [
         '/usr/local/zope/lib/python',
         ...
         ]
+    # Add the site_dirs before `addsitedir` in case it has setuptools.
+    sys.path.extend(site_dirs)
+    # Process .pth files.
+    for p in site_dirs:
+        site.addsitedir(p)
     <BLANKLINE>
     import os
     sys.argv[0] = os.path.abspath(sys.argv[0])
@@ -540,17 +594,28 @@
     >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
 
     >>> cat(sample_buildout, 'bin', 'testdemo') # doctest: +ELLIPSIS
-    #!/usr/local/bin/python2.4
+    #!python
     <BLANKLINE>
+    import site
     import sys
     sys.path[:] = [
+        ...
+        ]
+    sys.path.extend([
         '/sample-buildout/demo',
-        '/sample-buildout/eggs/zope.testing-3.0-py2.3.egg',
-        '/sample-buildout/eggs/zope.interface-3.4.1-py2.4.egg',
-        '/sample-buildout/eggs/setuptools-0.6-py1.3.egg',
+        '/sample-buildout/eggs/zope.testing-X-pyN.N.egg',
+        '/sample-buildout/eggs/zope.interface-X-pyN.N.egg'...
+        '/sample-buildout/eggs/setuptools-X-pyN.N.egg'
+        ])
+    site_dirs = [
         '/usr/local/zope/lib/python',
         ...
         ]
+    # Add the site_dirs before `addsitedir` in case it has setuptools.
+    sys.path.extend(site_dirs)
+    # Process .pth files.
+    for p in site_dirs:
+        site.addsitedir(p)
     <BLANKLINE>
     import os
     sys.argv[0] = os.path.abspath(sys.argv[0])
@@ -588,24 +653,35 @@
     >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
 
     >>> cat(sample_buildout, 'bin', 'testdemo') # doctest: +ELLIPSIS
-    #!/usr/local/bin/python2.4
+    #!python
     <BLANKLINE>
     import os
     <BLANKLINE>
     join = os.path.join
-    base = os.path.dirname(os.path.abspath(__file__))
+    base = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
     base = os.path.dirname(base)
     <BLANKLINE>
+    import site
     import sys
     sys.path[:] = [
+        ...
+        ]
+    sys.path.extend([
         join(base, 'demo'),
-        join(base, 'eggs/zope.testing-3.7.1-py2.4.egg'),
-        join(base, 'eggs/zope.interface-3.5.1-py2.4-linux-i686.egg'),
-        join(base, 'eggs/setuptools-0.6c9-py2.4.egg'),
+        join(base, 'eggs/zope.testing-X-pyN.N.egg'),
+        join(base, 'eggs/zope.interface-X-pyN.N.egg')...
+        join(base, 'eggs/setuptools-X-pyN.N.egg')
+        ])
+    site_dirs = [
         '/usr/local/zope/lib/python',
         join(base, 'sources'),
         ...
         ]
+    # Add the site_dirs before `addsitedir` in case it has setuptools.
+    sys.path.extend(site_dirs)
+    # Process .pth files.
+    for p in site_dirs:
+        site.addsitedir(p)
     <BLANKLINE>
     import os
     sys.argv[0] = os.path.abspath(sys.argv[0])
@@ -639,24 +715,35 @@
     >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
 
     >>> cat(sample_buildout, 'bin', 'testdemo') # doctest: +ELLIPSIS
-    #!/usr/local/bin/python2.4
+    #!python
     <BLANKLINE>
     import os
     <BLANKLINE>
     join = os.path.join
-    base = os.path.dirname(os.path.abspath(__file__))
+    base = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
     base = os.path.dirname(base)
     <BLANKLINE>
+    import site
     import sys
     sys.path[:] = [
+        ...
+        ]
+    sys.path.extend([
         join(base, 'demo'),
-        join(base, 'eggs/zope.testing-3.7.1-py2.4.egg'),
-        join(base, 'eggs/zope.interface-3.5.1-py2.4-linux-i686.egg'),
-        join(base, 'eggs/setuptools-0.6c9-py2.4.egg'),
+        join(base, 'eggs/zope.testing-X-pyN.N.egg'),
+        join(base, 'eggs/zope.interface-X-pyN.N.egg')...
+        join(base, 'eggs/setuptools-X-pyN.N.egg')
+        ])
+    site_dirs = [
         '/usr/local/zope/lib/python',
         join(base, 'sources'),
         ...
         ]
+    # Add the site_dirs before `addsitedir` in case it has setuptools.
+    sys.path.extend(site_dirs)
+    # Process .pth files.
+    for p in site_dirs:
+        site.addsitedir(p)
     <BLANKLINE>
     import os
     sys.argv[0] = os.path.abspath(sys.argv[0])

Modified: zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/bugfixes.txt
===================================================================
--- zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/bugfixes.txt	2009-09-04 15:29:36 UTC (rev 103549)
+++ zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/bugfixes.txt	2009-09-04 16:26:32 UTC (rev 103550)
@@ -79,12 +79,13 @@
 We can run the test script now:
 
 >>> print system(os.path.join(sample_buildout, 'bin', 'test') + ' -vv -j2'),
+... # doctest: +ELLIPSIS
 Running tests at level 1
 Running bugfix1.tests.Layer1 tests:
   Set up bugfix1.tests.Layer1 in 0.000 seconds.
   Running:
  test (bugfix1.tests.TestDemo1)
-  Ran 1 tests with 0 failures and 0 errors in 0.000 seconds.
+  Ran 1 tests with 0 failures and 0 errors in 0.000 seconds...
 Running bugfix1.tests.Layer2 tests:
   Running in a subprocess.
   Set up bugfix1.tests.Layer2 in 0.000 seconds.

Modified: zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/tests.py
===================================================================
--- zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/tests.py	2009-09-04 15:29:36 UTC (rev 103549)
+++ zc.recipe.testrunner/branches/gary-support-system-python/src/zc/recipe/testrunner/tests.py	2009-09-04 16:26:32 UTC (rev 103550)
@@ -13,9 +13,9 @@
 ##############################################################################
 
 import doctest
+import pkg_resources
 import re
 import unittest
-
 import zc.buildout.testing
 import zope.testing.doctest
 import zope.testing.renormalizing
@@ -27,6 +27,10 @@
     zc.buildout.testing.install_develop('zc.recipe.egg', test)
     zc.buildout.testing.install('zope.testing', test)
     zc.buildout.testing.install('zope.interface', test)
+    dist = pkg_resources.working_set.find(
+        pkg_resources.Requirement.parse('zope.exceptions'))
+    if dist is not None: # we are probably using zope.testing >= 3.8
+        zc.buildout.testing.install('zope.exceptions', test)
 
 def test_suite():
     return unittest.TestSuite((



More information about the checkins mailing list