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 ...@@ -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'), '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. # Setuptools now pulls in dependencies when installed.
adding_find_link = (re.compile(r"Adding find link '[^']+'" adding_find_link = (re.compile(r"Adding find link '[^']+'"
r" from setuptools .*\r?\n"), '') r" from setuptools .*\r?\n"), '')
......
...@@ -72,7 +72,7 @@ supply some input: ...@@ -72,7 +72,7 @@ supply some input:
... up ... up
... p sorted(self.options.keys()) ... p sorted(self.options.keys())
... q ... q
... """, with_exit_code=True), end='') ... """, with_exit_code=True), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Installing data-dir. Installing data-dir.
> /zc/buildout/buildout.py(925)__getitem__() > /zc/buildout/buildout.py(925)__getitem__()
...@@ -80,7 +80,7 @@ supply some input: ...@@ -80,7 +80,7 @@ supply some input:
(Pdb) > /sample-buildout/recipes/mkdir.py(14)install() (Pdb) > /sample-buildout/recipes/mkdir.py(14)install()
-> directory = self.options['directory'] -> directory = self.options['directory']
(Pdb) ['path', 'recipe'] (Pdb) ['path', 'recipe']
(Pdb) While: ...While:
Installing data-dir. Installing data-dir.
Traceback (most recent call last): Traceback (most recent call last):
File "/zc/buildout/buildout.py", line 1352, in main File "/zc/buildout/buildout.py", line 1352, in main
......
...@@ -3424,6 +3424,10 @@ def test_suite(): ...@@ -3424,6 +3424,10 @@ def test_suite():
zc.buildout.testing.adding_find_link, zc.buildout.testing.adding_find_link,
zc.buildout.testing.python27_warning, zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2, 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"Installing 'zc.buildout >=\S+"), ''),
(re.compile(r'__buildout_signature__ = recipes-\S+'), (re.compile(r'__buildout_signature__ = recipes-\S+'),
'__buildout_signature__ = recipes-SSSSSSSSSSS'), '__buildout_signature__ = recipes-SSSSSSSSSSS'),
...@@ -3469,6 +3473,10 @@ def test_suite(): ...@@ -3469,6 +3473,10 @@ def test_suite():
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link, 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"Installing 'zc.buildout >=\S+"), ''),
# (re.compile(r"Getting distribution for 'zc.buildout >=\S+"), # (re.compile(r"Getting distribution for 'zc.buildout >=\S+"),
# ''), # ''),
...@@ -3507,6 +3515,10 @@ def test_suite(): ...@@ -3507,6 +3515,10 @@ def test_suite():
zc.buildout.testing.normalize_exception_type_for_python_2_and_3, zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link, 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'), (re.compile('zc.buildout.buildout.MissingOption'),
'MissingOption'), 'MissingOption'),
(re.compile(r'\S+buildout.py'), 'buildout.py'), (re.compile(r'\S+buildout.py'), 'buildout.py'),
...@@ -3530,6 +3542,10 @@ def test_suite(): ...@@ -3530,6 +3542,10 @@ def test_suite():
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link, 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_bang,
normalize_S, normalize_S,
# (re.compile(r"Installing 'zc.buildout >=\S+"), ''), # (re.compile(r"Installing 'zc.buildout >=\S+"), ''),
...@@ -3563,6 +3579,10 @@ def test_suite(): ...@@ -3563,6 +3579,10 @@ def test_suite():
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning, zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2, 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_bang,
normalize_S, normalize_S,
(re.compile(r'[-d] setuptools-\S+[.]egg'), 'setuptools.egg'), (re.compile(r'[-d] setuptools-\S+[.]egg'), 'setuptools.egg'),
...@@ -3587,6 +3607,10 @@ def test_suite(): ...@@ -3587,6 +3607,10 @@ def test_suite():
zc.buildout.testing.normalize_exception_type_for_python_2_and_3, zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link, 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(' at -?0x[^>]+'), '<MEM ADDRESS>'),
(re.compile('http://localhost:[0-9]{4,5}/'), (re.compile('http://localhost:[0-9]{4,5}/'),
'http://localhost/'), 'http://localhost/'),
...@@ -3610,6 +3634,10 @@ def test_suite(): ...@@ -3610,6 +3634,10 @@ def test_suite():
zc.buildout.testing.adding_find_link, zc.buildout.testing.adding_find_link,
zc.buildout.testing.python27_warning, zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2, 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_bang,
(re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'), (re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'),
(re.compile(r"buildout: Running \S*setup.py"), (re.compile(r"buildout: Running \S*setup.py"),
...@@ -3661,6 +3689,10 @@ def test_suite(): ...@@ -3661,6 +3689,10 @@ def test_suite():
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.adding_find_link, 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+'), (re.compile(r'__buildout_signature__ = recipes-\S+'),
'__buildout_signature__ = recipes-SSSSSSSSSSS'), '__buildout_signature__ = recipes-SSSSSSSSSSS'),
(re.compile(r'[-d] setuptools-\S+[.]egg'), 'setuptools.egg'), (re.compile(r'[-d] setuptools-\S+[.]egg'), 'setuptools.egg'),
...@@ -3712,7 +3744,13 @@ def test_suite(): ...@@ -3712,7 +3744,13 @@ def test_suite():
test_suite.append( test_suite.append(
manuel.testing.TestSuite( manuel.testing.TestSuite(
manuel.doctest.Manuel( 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(), ) + manuel.capture.Manuel(),
os.path.join(docdir, 'getting-started.rst'), os.path.join(docdir, 'getting-started.rst'),
os.path.join(docdir, 'reference.rst'), os.path.join(docdir, 'reference.rst'),
......
...@@ -78,6 +78,10 @@ def test_suite(): ...@@ -78,6 +78,10 @@ def test_suite():
zc.buildout.testing.adding_find_link, zc.buildout.testing.adding_find_link,
zc.buildout.testing.python27_warning, zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2, 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_bang,
(re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'), (re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'),
(re.compile(r"buildout: Running \S*setup.py"), (re.compile(r"buildout: Running \S*setup.py"),
......
...@@ -406,6 +406,10 @@ def test_suite(): ...@@ -406,6 +406,10 @@ def test_suite():
zc.buildout.testing.adding_find_link, zc.buildout.testing.adding_find_link,
zc.buildout.testing.python27_warning, zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2, 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_bang,
(re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'), (re.compile(r'^(\w+\.)*(Missing\w+: )'), '\2'),
(re.compile(r"buildout: Running \S*setup.py"), (re.compile(r"buildout: Running \S*setup.py"),
......
...@@ -51,6 +51,10 @@ def test_suite(): ...@@ -51,6 +51,10 @@ def test_suite():
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning, zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2, 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)?'), (re.compile(r'[d-] zc.buildout(-\S+)?[.]egg(-link)?'),
'zc.buildout.egg'), 'zc.buildout.egg'),
(re.compile(r'[d-] setuptools-[^-]+-'), 'setuptools-X-'), (re.compile(r'[d-] setuptools-[^-]+-'), 'setuptools-X-'),
...@@ -69,6 +73,10 @@ def test_suite(): ...@@ -69,6 +73,10 @@ def test_suite():
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning, zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2, 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__ = ' (re.compile('__buildout_signature__ = '
r'sample-\S+\s+' r'sample-\S+\s+'
r'zc.recipe.egg-\S+\s+' r'zc.recipe.egg-\S+\s+'
...@@ -105,6 +113,10 @@ def test_suite(): ...@@ -105,6 +113,10 @@ def test_suite():
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning, zc.buildout.testing.python27_warning,
zc.buildout.testing.python27_warning_2, 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)" (re.compile("(d ((ext)?demo(needed)?|other)"
r"-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"), r"-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"),
'\\1V.V.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