Commit 79832abd authored by Jérome Perrin's avatar Jérome Perrin

tests: support python 3.11 tracebacks

parent 8fababe1
Pipeline #31894 passed with stage
in 0 seconds
...@@ -69,6 +69,7 @@ In case of error, a proper traceback is displayed and nothing is installed:: ...@@ -69,6 +69,7 @@ In case of error, a proper traceback is displayed and nothing is installed::
... ...
File "script", line 3, in <module> File "script", line 3, in <module>
print(1 / 0.) # this is an error ! print(1 / 0.) # this is an error !
~~^~~~
ZeroDivisionError: float division by zero ZeroDivisionError: float division by zero
>>> ls(sample_buildout, 'parts') >>> ls(sample_buildout, 'parts')
......
...@@ -647,8 +647,16 @@ renormalizing_patterns = [ ...@@ -647,8 +647,16 @@ renormalizing_patterns = [
), ''), ), ''),
(re.compile('Fetching origin\n'), ''), (re.compile('Fetching origin\n'), ''),
(re.compile('[0-9a-f]{32}'), md5sum), (re.compile('[0-9a-f]{32}'), md5sum),
(re.compile(r'http://localhost:\d+'), 'http://test.server'),
(re.compile(
r' print\(1 / 0.\) # this is an error !\n'
r'ZeroDivisionError'),
' print(1 / 0.) # this is an error !\n'
' ~~^~~~\n'
'ZeroDivisionError'),
] ]
def test_suite(): def test_suite():
suite = unittest.TestSuite(( suite = unittest.TestSuite((
doctest.DocFileSuite( doctest.DocFileSuite(
...@@ -657,9 +665,7 @@ def test_suite(): ...@@ -657,9 +665,7 @@ def test_suite():
setUp=setUp, setUp=setUp,
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=optionflags, optionflags=optionflags,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing(renormalizing_patterns),
(re.compile(r'http://localhost:\d+'), 'http://test.server'),
] + renormalizing_patterns),
globs={'MD5SUM': MD5SUM}, globs={'MD5SUM': MD5SUM},
), ),
unittest.makeSuite(DownloadTests), unittest.makeSuite(DownloadTests),
......
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