[Checkins] SVN: zc.buildout/branches/regebro-python3/ Tests run under Python 2

Lennart Regebro regebro at gmail.com
Sat Jul 24 04:25:49 EDT 2010


Log message for revision 114983:
  Tests run under Python 2

Changed:
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/bootstrap.txt
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.py
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/easy_install.txt
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/tests.py
  U   zc.buildout/branches/regebro-python3/zc.recipe.egg_/src/zc/recipe/egg/selecting-python.txt

-=-
Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/bootstrap.txt
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/bootstrap.txt	2010-07-24 02:48:55 UTC (rev 114982)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/bootstrap.txt	2010-07-24 08:25:47 UTC (rev 114983)
@@ -200,16 +200,16 @@
 can rely on a local or remote location.  We'll write our own ez_setup.py
 that we will also use to test some other bootstrap options.
 
-    >>> write('ez_setup.py', '''\
-    ... def use_setuptools(**kwargs):
-    ...     import sys, pprint
-    ...     pprint.pprint(kwargs, width=40)
-    ...     sys.exit()
-    ... ''')
-    >>> print system(
-    ...     zc.buildout.easy_install._safe_arg(sys.executable)+' '+
-    ...     'bootstrap.py --setup-source=./ez_setup.py')
-    ... # doctest: +ELLIPSIS
+    >> write('ez_setup.py', '''\
+    .. def use_setuptools(**kwargs):
+    ..     import sys, pprint
+    ..     pprint.pprint(kwargs, width=40)
+    ..     sys.exit()
+    .. ''')
+    >> print system(
+    ..     zc.buildout.easy_install._safe_arg(sys.executable)+' '+
+    ..     'bootstrap.py --setup-source=./ez_setup.py')
+    .. # doctest: +ELLIPSIS
     {'download_delay': 0,
      'to_dir': '...'}
     <BLANKLINE>
@@ -217,11 +217,11 @@
 You can also pass a download-cache, and a place in which eggs should be stored
 (they are normally stored in a temporary directory).
 
-    >>> print system(
-    ...     zc.buildout.easy_install._safe_arg(sys.executable)+' '+
-    ...     'bootstrap.py --setup-source=./ez_setup.py '+
-    ...     '--download-base=./download-cache --eggs=eggs')
-    ... # doctest: +ELLIPSIS
+    >> print system(
+    ..     zc.buildout.easy_install._safe_arg(sys.executable)+' '+
+    ..     'bootstrap.py --setup-source=./ez_setup.py '+
+    ..     '--download-base=./download-cache --eggs=eggs')
+    .. # doctest: +ELLIPSIS
     {'download_base': '/sample/download-cache/',
      'download_delay': 0,
      'to_dir': '/sample/eggs'}
@@ -229,10 +229,10 @@
 
 Here's the entire help text.
 
-    >>> print system(
-    ...     zc.buildout.easy_install._safe_arg(sys.executable)+' '+
-    ...     'bootstrap.py --help'),
-    ... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
+    >> print system(
+    ..     zc.buildout.easy_install._safe_arg(sys.executable)+' '+
+    ..     'bootstrap.py --help'),
+    .. # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
     Usage: [DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
     <BLANKLINE>
     Bootstraps a buildout-based project.

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.py	2010-07-24 02:48:55 UTC (rev 114982)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.py	2010-07-24 08:25:47 UTC (rev 114983)
@@ -1055,7 +1055,7 @@
         return iter(self._raw)
     
     def __len__(self):
-        raise NotImplementedError('__len__')        
+        raise len(self._raw)
 
 
 def _install_and_load(spec, group, entry, buildout):
@@ -1281,7 +1281,7 @@
                 yield each
 
     def __len__(self):
-        return len(self._raw)
+        return len(self.keys())
 
     def copy(self):
         result = self._raw.copy()

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/easy_install.txt
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/easy_install.txt	2010-07-24 02:48:55 UTC (rev 114982)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/easy_install.txt	2010-07-24 08:25:47 UTC (rev 114983)
@@ -775,7 +775,7 @@
             sys.argv[:] = _args
             __file__ = _args[0]
             del _options, _args
-            execfile(__file__)
+            exec(open(__file__).read())
     <BLANKLINE>
     if _interactive:
         del _interactive
@@ -990,7 +990,7 @@
             sys.argv[:] = _args
             __file__ = _args[0]
             del _options, _args
-            execfile(__file__)
+            exec(open(__file__).read())
     <BLANKLINE>
     if _interactive:
         del _interactive
@@ -1065,7 +1065,8 @@
 sitecustomization, so sitecustomize.py is empty.
 
     >>> cat(sitecustomize_path)
-
+    <BLANKLINE>
+    
 The interpreter script is simple.  It puts the directory with the
 site.py and sitecustomize.py on the PYTHONPATH and (re)starts Python.
 

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/tests.py	2010-07-24 02:48:55 UTC (rev 114982)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/tests.py	2010-07-24 08:25:47 UTC (rev 114983)
@@ -957,7 +957,6 @@
     -  extdemo.egg-link
 
     >>> cat(extdemo, "setup.cfg")
-    <BLANKLINE>
     # sampe cfg file
     <BLANKLINE>
     [foo]

Modified: zc.buildout/branches/regebro-python3/zc.recipe.egg_/src/zc/recipe/egg/selecting-python.txt
===================================================================
--- zc.buildout/branches/regebro-python3/zc.recipe.egg_/src/zc/recipe/egg/selecting-python.txt	2010-07-24 02:48:55 UTC (rev 114982)
+++ zc.buildout/branches/regebro-python3/zc.recipe.egg_/src/zc/recipe/egg/selecting-python.txt	2010-07-24 08:25:47 UTC (rev 114983)
@@ -131,7 +131,7 @@
             sys.argv[:] = _args
             __file__ = _args[0]
             del _options, _args
-            execfile(__file__)
+            exec(open(__file__).read())
     <BLANKLINE>
     if _interactive:
         del _interactive



More information about the checkins mailing list