Package: src:python-docformatter
Version: 1.7.5-1
Severity: important
Tags: sid trixie
User: debian-pyt...@lists.debian.org
Usertags: python3.12
python-docformatter's autopkg tests fail with Python 3.12:
complete build log at
https://autopkgtest.ubuntu.com/results/autopkgtest-noble/noble/amd64/p/python-docformatter/20231118_184558_0bbe1@/log.gz
[...]
277s autopkgtest [18:41:15]: test upstream: [-----------------------
278s ============================= test session starts
==============================
278s platform linux -- Python 3.12.0+, pytest-7.4.3, pluggy-1.3.0
278s rootdir: /tmp/autopkgtest.F10r2v/autopkgtest_tmp
278s configfile: pyproject.toml
278s collected 277 items
278s
278s tests/test_configuration_functions.py ....................
[ 7%]
280s tests/test_docformatter.py ...........FF..F.FFFFFFFFFFFFFFFFFFFFFFF
[ 21%]
280s tests/test_encoding_functions.py ............
[ 25%]
280s tests/test_string_functions.py ...............................
[ 37%]
280s tests/test_strip_docstring.py ........
[ 40%]
280s tests/test_syntax_functions.py ......
[ 42%]
281s tests/test_utility_functions.py
.x...................................... [ 56%]
281s ..
[ 57%]
281s tests/formatter/test_do_format_code.py ..FFF.............
[ 63%]
281s tests/formatter/test_do_format_docstring.py ..............
[ 68%]
281s tests/formatter/test_format_black.py ...
[ 70%]
281s tests/formatter/test_format_code.py ............................
[ 80%]
281s tests/formatter/test_format_code_ranges.py ...
[ 81%]
281s tests/formatter/test_format_epytext.py ..
[ 81%]
281s tests/formatter/test_format_lists.py .....
[ 83%]
281s tests/formatter/test_format_sphinx.py ..........
[ 87%]
281s tests/formatter/test_format_styles.py ....
[ 88%]
281s tests/formatter/test_format_urls.py .................
[ 94%]
281s tests/formatter/test_format_wrap.py ..............
[100%]
281s
281s =================================== FAILURES
===================================
281s _ TestEndToEnd.test_end_to_end[arguments0- def foo():\n
"""\n Hello world\n """\n] _
281s
281s self = <tests.test_docformatter.TestEndToEnd object at 0x7f834ecdcd70>
281s temporary_file = '/tmp/autopkgtest.F10r2v/autopkgtest_tmp/mo2206f7.py'
281s contents = ' def foo():\n """\n Hello world\n
"""\n'
281s run_docformatter = <Popen: returncode: 1 args:
['/usr/bin/docformatter', '/tmp/autopkgtest.F10r...>
281s arguments = ['/tmp/autopkgtest.F10r2v/autopkgtest_tmp/mo2206f7.py']
281s
281s @pytest.mark.system
281s @pytest.mark.parametrize(
281s "contents",
281s [
281s '''\
281s def foo():
281s """
281s Hello world
281s """
281s '''
281s ],
281s )
281s @pytest.mark.parametrize("arguments", [[]])
281s def test_end_to_end(
281s self,
281s temporary_file,
281s contents,
281s run_docformatter,
281s arguments,
281s ):
281s """"""
281s > assert '''\
281s @@ -1,4 +1,2 @@
281s def foo():
281s - """
281s - Hello world
281s - """
281s + """Hello world."""
281s ''' == "\n".join(
281s
run_docformatter.communicate()[0].decode().replace("\r", "").split("\n")[2:]
281s )
281s E assert '@@ -1,4 +1,2...o world."""\n' == ''
281s E + @@ -1,4 +1,2 @@
281s E + def foo():
281s E + - """
281s E + - Hello world
281s E + - """
281s E + + """Hello world."""
281s
281s tests/test_docformatter.py:272: AssertionError
281s _ TestEndToEnd.test_end_to_end_with_wrapping[arguments0-def
foo():\n """\n Hello world this is a summary that will get
wrapped\n """\n] _
281s
281s self = <tests.test_docformatter.TestEndToEnd object at 0x7f834ecdcfb0>
281s run_docformatter = <Popen: returncode: 1 args:
['/usr/bin/docformatter', '--wrap-summaries=40',...>
281s temporary_file = '/tmp/autopkgtest.F10r2v/autopkgtest_tmp/2x4of_22.py'
281s contents = 'def foo():\n """\n Hello world this is a summary
that will get wrapped\n """\n'
281s arguments = ['--wrap-summaries=40',
'/tmp/autopkgtest.F10r2v/autopkgtest_tmp/2x4of_22.py']
281s
281s @pytest.mark.system
281s @pytest.mark.parametrize(
281s "contents",
281s [
281s '''\
281s def foo():
281s """
281s Hello world this is a summary that will get wrapped
281s """
281s '''
281s ],
281s )
281s @pytest.mark.parametrize("arguments",
[["--wrap-summaries=40"]])
281s def test_end_to_end_with_wrapping(
281s self,
281s run_docformatter,
281s temporary_file,
281s contents,
281s arguments,
281s ):
281s """Wrap summary at --wrap-summaries number of columns."""
281s > assert '''\
281s @@ -1,4 +1,3 @@
281s def foo():
281s - """
281s - Hello world this is a summary that will get wrapped
281s - """
281s + """Hello world this is a summary
281s + that will get wrapped."""
281s ''' == "\n".join(
281s
run_docformatter.communicate()[0].decode().replace("\r", "").split("\n")[2:]
281s )
281s E assert '@@ -1,4 +1,3...wrapped."""\n' == ''
281s E + @@ -1,4 +1,3 @@
281s E + def foo():
281s E + - """
281s E + - Hello world this is a summary that will get
wrapped
281s E + - """
281s E + + """Hello world this is a summary
281s E + + that will get wrapped."""
281s
281s tests/test_docformatter.py:304: AssertionError
281s _ TestEndToEnd.test_end_to_end_no_wrapping_period[arguments0-def
foo():\n """Wrapping is off, but it will still add\n the trailing
period """\n] _
281s
281s self = <tests.test_docformatter.TestEndToEnd object at 0x7f834ecdc4d0>
281s run_docformatter = <Popen: returncode: 1 args:
['/usr/bin/docformatter', '--wrap-summaries=0', ...>
281s temporary_file = '/tmp/autopkgtest.F10r2v/autopkgtest_tmp/ouaars6m.py'
281s arguments = ['--wrap-summaries=0',
'/tmp/autopkgtest.F10r2v/autopkgtest_tmp/ouaars6m.py']
281s contents = 'def foo():\n """Wrapping is off, but it will still
add\n the trailing period """\n'
281s
281s @pytest.mark.system
281s @pytest.mark.parametrize(
281s "contents",
281s [
281s '''\
281s def foo():
281s """Wrapping is off, but it will still add
281s the trailing period """
281s '''
281s ],
281s )
281s @pytest.mark.parametrize("arguments", [["--wrap-summaries=0"]])
281s def test_end_to_end_no_wrapping_period(
281s self,
281s run_docformatter,
281s temporary_file,
281s arguments,
281s contents,
281s ):
281s """Add period to end of summary even with wrapping off."""
281s > assert '''\
281s @@ -1,3 +1,3 @@
281s def foo():
281s """Wrapping is off, but it will still add
281s - the trailing period """
281s + the trailing period."""
281s ''' == "\n".join(
281s
run_docformatter.communicate()[0].decode().replace("\r", "").split("\n")[2:]
281s )
281s E assert '@@ -1,3 +1,3... period."""\n' == ''
281s E + @@ -1,3 +1,3 @@
281s E + def foo():
281s E + """Wrapping is off, but it will still add
281s E + - the trailing period """
281s E + + the trailing period."""
281s
281s tests/test_docformatter.py:394: AssertionError
281s _ TestEndToEnd.test_ignore_already_wrapped_link[arguments0-def
foo():\n """Description from issue #150 that was being improperly
wrapped.\n\n The text file can be retrieved via the Chrome plugin
`Get\n Cookies.txt <https://chrome.google.com/webstore/detail/get-\n
cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid>` while browsing."""\n] _
281s
281s self = <tests.test_docformatter.TestEndToEnd object at 0x7f834ecdc260>
281s run_docformatter = <Popen: returncode: 1 args:
['/usr/bin/docformatter', '--wrap-summaries=72',...>
281s temporary_file = '/tmp/autopkgtest.F10r2v/autopkgtest_tmp/2wojkxu6.py'
281s arguments = ['--wrap-summaries=72', '--wrap-descriptions=78',
'/tmp/autopkgtest.F10r2v/autopkgtest_tmp/2wojkxu6.py']
281s contents = 'def foo():\n """Description from issue #150 that was
being improperly wrapped.\n\n The text file can be
retriev...https://chrome.google.com/webstore/detail/get-\n
cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid>` while browsing."""\n'
281s
281s @pytest.mark.system
281s @pytest.mark.parametrize(
281s "contents",
281s [
281s '''\
281s def foo():
281s """Description from issue #150 that was being improperly
wrapped.
281s
281s The text file can be retrieved via the Chrome plugin `Get
281s Cookies.txt <https://chrome.google.com/webstore/detail/get-
281s cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid>` while
browsing."""
281s '''
281s ],
281s )
281s @pytest.mark.parametrize(
281s "arguments",
281s [
281s [
281s "--wrap-summaries=72",
281s "--wrap-descriptions=78",
281s ]
281s ],
281s )
281s def test_ignore_already_wrapped_link(
281s self,
281s run_docformatter,
281s temporary_file,
281s arguments,
281s contents,
281s ):
281s """Ignore a URL link that was wrapped by the user.
281s
281s See issue #150.
281s """
281s > assert '''\
281s @@ -1,6 +1,7 @@
281s def foo():
281s """Description from issue #150 that was being improperly
wrapped.
281s
281s - The text file can be retrieved via the Chrome plugin `Get
281s - Cookies.txt <https://chrome.google.com/webstore/detail/get-
281s - cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid>` while
browsing."""
281s + The text file can be retrieved via the Chrome plugin
281s + `Get Cookies.txt
<https://chrome.google.com/webstore/detail/get-
281s + cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid>` while browsing.
281s + """
281s ''' == "\n".join(
281s
run_docformatter.communicate()[0].decode().replace("\r", "").split("\n")[2:]
281s )
281s E assert '@@ -1,6 +1,7....\n+ """\n' == ''
281s E + @@ -1,6 +1,7 @@
281s E + def foo():
281s E + """Description from issue #150 that was being
improperly wrapped.
281s E +
281s E + - The text file can be retrieved via the Chrome
plugin `Get
281s E + - Cookies.txt
<https://chrome.google.com/webstore/detail/get-
281s E + - cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid>`
while browsing."""...
281s E
281s E ...Full output truncated (4 lines hidden), use '-vv'
to show
281s
281s tests/test_docformatter.py:477: AssertionError
281s _
TestEndToEnd.test_end_to_end_no_excessive_whitespace[arguments0-"""Create
a wrapper around a WiX install.\n\n :param tools: ToolCache of
available tools.\n :param wix_home: The path of the WiX
installation.\n :param bin_install: Is the install a binaries-only
install? A full\n MSI install of WiX has a `/bin` folder in the
paths; a\n binaries-only install does not.\n :returns: A valid
WiX SDK wrapper. If WiX is not available, and was\n not
installed, raises MissingToolError.\n """] _
281s
281s self = <tests.test_docformatter.TestEndToEnd object at 0x7f834ec74fe0>
281s run_docformatter = <Popen: returncode: 1 args:
['/usr/bin/docformatter', '--black', '/tmp/autop...>
281s temporary_file = '/tmp/autopkgtest.F10r2v/autopkgtest_tmp/02d6c0pq.py'
281s arguments = ['--black',
'/tmp/autopkgtest.F10r2v/autopkgtest_tmp/02d6c0pq.py']
281s contents = '"""Create a wrapper around a WiX install.\n\n :param
tools: ToolCache of available tools.\n :param wix_home: Th...s: A
valid WiX SDK wrapper. If WiX is not available, and was\n not
installed, raises MissingToolError.\n """'
281s
281s @pytest.mark.system
281s @pytest.mark.parametrize(
281s "contents",
281s [
281s '''\
281s """Create a wrapper around a WiX install.
281s
281s :param tools: ToolCache of available tools.
281s :param wix_home: The path of the WiX installation.
281s :param bin_install: Is the install a binaries-only install?
A full
281s MSI install of WiX has a `/bin` folder in the paths; a
281s binaries-only install does not.
281s :returns: A valid WiX SDK wrapper. If WiX is not available,
and was
281s not installed, raises MissingToolError.
281s """\
281s '''
281s ],
281s )
281s @pytest.mark.parametrize(
281s "arguments",
281s [["--black"]],
281s )
281s def test_end_to_end_no_excessive_whitespace(
281s self,
281s run_docformatter,
281s temporary_file,
281s arguments,
281s contents,
281s ):
281s """Remove all excess whitespace in the middle of
wrappped lines.
281s
281s See issue #222.
281s """
281s > assert '''\
281s @@ -1,10 +1,9 @@
281s """Create a wrapper around a WiX install.
281s
281s - :param tools: ToolCache of available tools.
281s - :param wix_home: The path of the WiX installation.
281s - :param bin_install: Is the install a binaries-only
install? A full
281s - MSI install of WiX has a `/bin` folder in the paths; a
281s - binaries-only install does not.
281s - :returns: A valid WiX SDK wrapper. If WiX is not
available, and was
281s - not installed, raises MissingToolError.
281s - """
281s +:param tools: ToolCache of available tools.
281s +:param wix_home: The path of the WiX installation.
281s +:param bin_install: Is the install a binaries-only install? A
full MSI install of WiX
281s +has a `/bin` folder in the paths; a binaries-only install does
not.
281s +:returns: A valid WiX SDK wrapper. If WiX is not available,
and was not installed,
281s +raises MissingToolError.
281s +"""
281s ''' == "\n".join(
281s
run_docformatter.communicate()[0].decode().replace("\r", "").split("\n")[2:]
281s )
281s E assert '@@ -1,10 +1,...rror.\n+"""\n' == ''
281s E + @@ -1,10 +1,9 @@
281s E + """Create a wrapper around a WiX install.
281s E +
281s E + - :param tools: ToolCache of available tools.
281s E + - :param wix_home: The path of the WiX installation.
281s E + - :param bin_install: Is the install a
binaries-only install? A full
281s E + - MSI install of WiX has a `/bin` folder in
the paths; a...
281s E
281s E ...Full output truncated (11 lines hidden), use '-vv'
to show
281s
281s tests/test_docformatter.py:526: AssertionError
281s _ TestEndToEnd.test_end_to_end_all_options[arguments0-def foo():\n
"""Hello world is a long sentence that will be wrapped at 40
characters because I'm using that option\n - My list item\n - My
list item\n\n\n """\n] _
281s
281s self = <tests.test_docformatter.TestEndToEnd object at 0x7f834ec75280>
281s run_docformatter = <Popen: returncode: 1 args:
['/usr/bin/docformatter', '--wrap-summaries=40',...>
281s temporary_file = '/tmp/autopkgtest.F10r2v/autopkgtest_tmp/gvm753xk.py'
281s arguments = ['--wrap-summaries=40', '--pre-summary-newline',
'--blank', '/tmp/autopkgtest.F10r2v/autopkgtest_tmp/gvm753xk.py']
281s contents = 'def foo():\n """Hello world is a long sentence that
will be wrapped at 40 characters because I\'m using that option\n -
My list item\n - My list item\n\n\n """\n'
281s
281s @pytest.mark.system
281s @pytest.mark.parametrize(
281s "contents",
281s [
281s '''\
281s def foo():
281s """Hello world is a long sentence that will be wrapped at
40 characters because I'm using that option
281s - My list item
281s - My list item
281s
281s
281s """
281s '''
281s ],
281s )
281s @pytest.mark.parametrize(
281s "arguments",
281s [
281s [
281s "--wrap-summaries=40",
281s "--pre-summary-newline",
281s "--blank",
281s ]
281s ],
281s )
281s def test_end_to_end_all_options(
281s self,
281s run_docformatter,
281s temporary_file,
281s arguments,
281s contents,
281s ):
281s """"""
281s > assert '''\
281s @@ -1,7 +1,10 @@
281s def foo():
281s - """Hello world is a long sentence that will be wrapped at
40 characters because I'm using that option
281s + """
281s + Hello world is a long sentence that
281s + will be wrapped at 40 characters
281s + because I'm using that option.
281s +
281s - My list item
281s - My list item
281s
281s -
281s """
281s ''' == "\n".join(
281s
run_docformatter.communicate()[0].decode().replace("\r", "").split("\n")[2:]
281s )
281s E assert '@@ -1,7 +1,1...-\n """\n' == ''
281s E + @@ -1,7 +1,10 @@
281s E + def foo():
281s E + - """Hello world is a long sentence that will be
wrapped at 40 characters because I'm using that option
281s E + + """
281s E + + Hello world is a long sentence that
281s E + + will be wrapped at 40 characters
281s E + + because I'm using that option....
281s E
281s E ...Full output truncated (6 lines hidden), use '-vv'
to show
281s
281s tests/test_docformatter.py:582: AssertionError
281s _________________ TestEndToEnd.test_invalid_range[arguments0-]
_________________
281s
281s self = <tests.test_docformatter.TestEndToEnd object at 0x7f834ec75520>
281s run_docformatter = <Popen: returncode: 1 args:
['/usr/bin/docformatter', '--range', '0', '1', '...>
281s arguments = ['--range', '0', '1', '/dev/null',
'/tmp/autopkgtest.F10r2v/autopkgtest_tmp/5kxvdgcw.py']
281s contents = ''
281s
281s @pytest.mark.system
281s @pytest.mark.parametrize("contents", [""])
281s @pytest.mark.parametrize(
281s "arguments",
281s [
281s ["--range", "0", "1", os.devnull],
281s ["--range", "3", "1", os.devnull],
281s ],
281s )
281s def test_invalid_range(
281s self,
281s run_docformatter,
281s arguments,
281s contents,
281s ):
281s """"""
281s if arguments[1] == "0":
281s > assert "must be positive" in
run_docformatter.communicate()[1].decode()
281s E assert 'must be positive' in 'Traceback (most recent
call last):\n File "/usr/bin/docformatter", line 3, in <module>\n
import re\n File "/usr/...sert _sre.MAGIC == MAGIC, "SRE module
mismatch"\n ^^^^^^^^^^^^^^^^^^^\nAssertionError: SRE module
mismatch\n'
281s E + where 'Traceback (most recent call last):\n File
"/usr/bin/docformatter", line 3, in <module>\n import re\n File
"/usr/...sert _sre.MAGIC == MAGIC, "SRE module mismatch"\n
^^^^^^^^^^^^^^^^^^^\nAssertionError: SRE module mismatch\n' = <built-in
method decode of bytes object at 0x273fb00>()
281s E + where <built-in method decode of bytes object at
0x273fb00> = b'Traceback (most recent call last):\n File
"/usr/bin/docformatter", line 3, in <module>\n import re\n File
"/usr...sert _sre.MAGIC == MAGIC, "SRE module mismatch"\n
^^^^^^^^^^^^^^^^^^^\nAssertionError: SRE module mismatch\n'.decode
281s
281s tests/test_docformatter.py:617: AssertionError