Commit 407036cd authored by Jim Fulton's avatar Jim Fulton

more tests passing w python 3.2

parent 70c9ae13
......@@ -67,7 +67,7 @@ class MissingSection(zc.buildout.UserError, KeyError):
"""
def __str__(self):
return "The referenced section, %r, was not defined." % self[0]
return "The referenced section, %r, was not defined." % self.args[0]
def _annotate_section(section, note):
......
......@@ -461,6 +461,13 @@ normalize_script = (
re.compile('(\n?)- ([a-zA-Z_.-]+)-script.py\n- \\2.exe\n'),
'\\1- \\2\n')
if sys.version_info > (2, ):
normalize___pycache__ = (
re.compile('(\n?)d __pycache__\n'), '\\1')
else:
normalize___pycache__ = (
re.compile('(\n?)- \S+\.pyc\n'), '\\1')
normalize_egg_py = (
re.compile('-py\d[.]\d(-\S+)?.egg'),
'-pyN.N.egg',
......@@ -469,3 +476,4 @@ normalize_egg_py = (
normalize_exception_type_for_python_2_and_3 = (
re.compile(r'^(\w+\.)*([A-Z][A-Za-z0-9]+Error: )'),
'\2')
......@@ -943,7 +943,10 @@ def extensions_installed_as_eggs_work_in_offline_mode():
>>> mkdir('demo')
>>> write('demo', 'demo.py',
... """
... r"""
... import sys
... def print_(*args):
... sys.stdout.write(' '.join(map(str, args)) + '\\n')
... def ext(buildout):
... print_('ext', list(buildout))
... """)
......@@ -1070,7 +1073,6 @@ because of the missing target file.
>>> ls('recipe')
l another-file
- foo.py
- foo.pyc
d recipe.egg-info
- setup.py
- some-file
......@@ -1815,7 +1817,7 @@ def bug_59270_recipes_always_start_in_buildout_dir():
... r'''
... import os, sys
... def print_(*args):
... sys.stdout.write(' '.join(map(str, args)))
... sys.stdout.write(' '.join(map(str, args)) + '\n')
... class Bad:
... def __init__(self, *_):
... print_(os.getcwd())
......@@ -1856,7 +1858,6 @@ def bug_59270_recipes_always_start_in_buildout_dir():
Installing b2.
/sample-buildout
/sample-buildout/bad_start
"""
def bug_61890_file_urls_dont_seem_to_work_in_find_dash_links():
......@@ -1929,15 +1930,14 @@ def dealing_with_extremely_insane_dependencies():
... eggs = pack0
... ''')
>>> print_(system(buildout), end='')
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/pack0'
Develop: '/sample-buildout/pack1'
Develop: '/sample-buildout/pack2'
Develop: '/sample-buildout/pack3'
Develop: '/sample-buildout/pack4'
Installing pack1.
Couldn't find index page for 'pack5' (maybe misspelled?)
Getting distribution for 'pack5'.
...
While:
Installing pack1.
Getting distribution for 'pack5'.
......@@ -1979,8 +1979,7 @@ def dealing_with_extremely_insane_dependencies():
Getting required 'pack5'
required by pack4 0.0.0.
We have no distributions for pack5 that satisfies 'pack5'.
Couldn't find index page for 'pack5' (maybe misspelled?)
Getting distribution for 'pack5'.
...
While:
Installing pack1.
Getting distribution for 'pack5'.
......@@ -2499,7 +2498,7 @@ def make_sure_versions_dont_cancel_extras():
"""
There was a bug that caused extras in requirements to be lost.
>>> open('setup.py', 'w').write('''
>>> _ = open('setup.py', 'w').write('''
... from setuptools import setup
... setup(name='extraversiondemo', version='1.0',
... url='x', author='x', author_email='x',
......@@ -3064,6 +3063,8 @@ def test_suite():
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.normalize___pycache__,
(re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'),
(re.compile("buildout: Running \S*setup.py"),
'buildout: Running setup.py'),
(re.compile('distribute-\S+-'),
......@@ -3083,7 +3084,8 @@ def test_suite():
),
(re.compile(r'^[*]...'), '...'),
# for
# bug_92891_bootstrap_crashes_with_egg_recipe_in_buildout_section
# bug_92891
# bootstrap_crashes_with_egg_recipe_in_buildout_section
(re.compile(r"Unused options for buildout: 'eggs' 'scripts'\."),
"Unused options for buildout: 'scripts' 'eggs'."),
]),
......
......@@ -21,7 +21,7 @@ around the egg recipe:
... import zc.recipe.egg
...
... def print_(*args):
... sys.stdout.write(' '.join(map(str, args)))
... sys.stdout.write(' '.join(map(str, args)) + '\n')
...
... class Sample:
...
......
......@@ -158,7 +158,7 @@ Let's define a script that uses out ext demo:
... """
... import extdemo, sys
... def print_(*args):
... sys.stdout.write(' '.join(map(str, args)))
... sys.stdout.write(' '.join(map(str, args)) + '\n')
... def main():
... print_(extdemo.val)
... """)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment