Commit 2480e5b6 authored by Godefroid Chapelle's avatar Godefroid Chapelle

Problem: setuptools deprecation warnings break tests

Solution: hide them in doctests
parent 95e8965a
......@@ -608,6 +608,11 @@ python27_warning_2 = (re.compile(r'DEPRECATION: Python 2.7 reached the end of it
'https://pip.pypa.io/en/latest/development/release-process/#python-2-support\n'),
'')
easyinstall_deprecated = (re.compile(r'.*EasyInstallDeprecationWarning.*\n'),'')
setuptools_deprecated = (re.compile(r'.*SetuptoolsDeprecationWarning.*\n'),'')
pkg_resources_deprecated = (re.compile(r'.*PkgResourcesDeprecationWarning.*\n'),'')
warnings_warn = (re.compile(r'.*warnings\.warn.*\n'),'')
# Setuptools now pulls in dependencies when installed.
adding_find_link = (re.compile(r"Adding find link '[^']+'"
r" from setuptools .*\r?\n"), '')
......
......@@ -72,7 +72,7 @@ supply some input:
... up
... p sorted(self.options.keys())
... q
... """, with_exit_code=True), end='')
... """, with_exit_code=True), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/recipes'
Installing data-dir.
> /zc/buildout/buildout.py(925)__getitem__()
......@@ -80,7 +80,7 @@ supply some input:
(Pdb) > /sample-buildout/recipes/mkdir.py(14)install()
-> directory = self.options['directory']
(Pdb) ['path', 'recipe']
(Pdb) While:
...While:
Installing data-dir.
Traceback (most recent call last):
File "/zc/buildout/buildout.py", line 1352, in main
......
......@@ -3424,6 +3424,10 @@ def test_suite():
zc.buildout.testing.adding_find_link,
zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
# (re.compile(r"Installing 'zc.buildout >=\S+"), ''),
(re.compile(r'__buildout_signature__ = recipes-\S+'),
'__buildout_signature__ = recipes-SSSSSSSSSSS'),
......@@ -3469,6 +3473,10 @@ def test_suite():
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
# (re.compile(r"Installing 'zc.buildout >=\S+"), ''),
# (re.compile(r"Getting distribution for 'zc.buildout >=\S+"),
# ''),
......@@ -3507,6 +3515,10 @@ def test_suite():
zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
(re.compile('zc.buildout.buildout.MissingOption'),
'MissingOption'),
(re.compile(r'\S+buildout.py'), 'buildout.py'),
......@@ -3530,6 +3542,10 @@ def test_suite():
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
normalize_bang,
normalize_S,
# (re.compile(r"Installing 'zc.buildout >=\S+"), ''),
......@@ -3563,6 +3579,10 @@ def test_suite():
zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
normalize_bang,
normalize_S,
(re.compile(r'[-d] setuptools-\S+[.]egg'), 'setuptools.egg'),
......@@ -3587,6 +3607,10 @@ def test_suite():
zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
(re.compile(' at -?0x[^>]+'), '<MEM ADDRESS>'),
(re.compile('http://localhost:[0-9]{4,5}/'),
'http://localhost/'),
......@@ -3610,6 +3634,10 @@ def test_suite():
zc.buildout.testing.adding_find_link,
zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
normalize_bang,
(re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'),
(re.compile(r"buildout: Running \S*setup.py"),
......@@ -3661,6 +3689,10 @@ def test_suite():
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
(re.compile(r'__buildout_signature__ = recipes-\S+'),
'__buildout_signature__ = recipes-SSSSSSSSSSS'),
(re.compile(r'[-d] setuptools-\S+[.]egg'), 'setuptools.egg'),
......@@ -3712,7 +3744,13 @@ def test_suite():
test_suite.append(
manuel.testing.TestSuite(
manuel.doctest.Manuel(
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
checker=renormalizing.RENormalizing([
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
]),
) + manuel.capture.Manuel(),
os.path.join(docdir, 'getting-started.rst'),
os.path.join(docdir, 'reference.rst'),
......
......@@ -78,6 +78,10 @@ def test_suite():
zc.buildout.testing.adding_find_link,
zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
normalize_bang,
(re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'),
(re.compile(r"buildout: Running \S*setup.py"),
......
......@@ -406,6 +406,10 @@ def test_suite():
zc.buildout.testing.adding_find_link,
zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
normalize_bang,
(re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'),
(re.compile(r"buildout: Running \S*setup.py"),
......
......@@ -51,6 +51,10 @@ def test_suite():
zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
(re.compile(r'[d-] zc.buildout(-\S+)?[.]egg(-link)?'),
'zc.buildout.egg'),
(re.compile(r'[d-] setuptools-[^-]+-'), 'setuptools-X-'),
......@@ -69,6 +73,10 @@ def test_suite():
zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
(re.compile('__buildout_signature__ = '
r'sample-\S+\s+'
r'zc.recipe.egg-\S+\s+'
......@@ -105,6 +113,10 @@ def test_suite():
zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2,
zc.buildout.testing.easyinstall_deprecated,
zc.buildout.testing.setuptools_deprecated,
zc.buildout.testing.pkg_resources_deprecated,
zc.buildout.testing.warnings_warn,
(re.compile("(d ((ext)?demo(needed)?|other)"
r"-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"),
'\\1V.V.egg'),
......
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