FS#70926 - [python-sphinxcontrib-trio] FTBFS 1.1.2-1

Attached to Project: Community Packages
Opened by kpcyrd (kpcyrd) - Monday, 17 May 2021, 23:17 GMT
Last edited by Toolybird (Toolybird) - Saturday, 24 December 2022, 04:50 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The tests started failing on a recent Arch Linux:

```
==> Starting check()...
============================= test session starts ==============================
platform linux -- Python 3.9.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /build/python-sphinxcontrib-trio/src/sphinxcontrib-trio-1.1.2
collected 3 items

tests/test_sphinxcontrib_trio.py .F. [100%]

=================================== FAILURES ===================================
_______________________________ test_end_to_end ________________________________

tmpdir = local('/tmp/pytest-of-builduser/pytest-0/test_end_to_end0')

def test_end_to_end(tmpdir):
shutil.copytree(str(Path(__file__).parent / "test-docs-source"),
str(tmpdir / "test-docs-source"))
subprocess.run(
["sphinx-build", "-v", "-nW", "-nb", "html",
str(tmpdir / "test-docs-source"), str(tmpdir / "out")])

tree = lxml.html.parse(str(tmpdir / "out" / "test.html")).getroot()

def do_html_test(node, *, expect_match):
original_content = node.text_content()
print("\n-- test case --\n", lxml.html.tostring(node, encoding="unicode"))

check_tags = node.cssselect(".highlight-none")
checks = []
for tag in check_tags:
text = tag.text_content().strip()
# lxml normalizes &nbsp to the unicode \xa0, so we do the same
text = text.replace(" ", "\xa0")
checks.append(text)
tag.drop_tree()

# make sure we removed the tests from the top-level node, to avoid
# potential false positives matching on the tests themselves!
assert len(node.text_content()) < len(original_content)
assert checks

test_content = lxml.html.tostring(node, encoding="unicode")
# some versions of sphinx (>= 1.6) replace "..." with the ellipsis
# character \u2026. Normalize back to "..." for comparison
# purposes.
test_content = test_content.replace("\u2026", "...")
for check in checks:
try:
if expect_match:
assert re.search(check, test_content) is not None
else:
assert re.search(check, test_content) is None
except AssertionError:
print("failed check")
print()
print(repr(check))
print()
print("failed test_content")
print()
print(repr(test_content))
raise

print("\n-- NEGATIVE (WARNING) TESTS --\n")

for warning in tree.cssselect(".warning"):
do_html_test(warning, expect_match=False)

print("\n-- POSITIVE (NOTE) TESTS --\n")

for note in tree.cssselect(".note"):
> do_html_test(note, expect_match=True)

tests/test_sphinxcontrib_trio.py:241:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

node = <Element div at 0x7f9fa2eee680>

def do_html_test(node, *, expect_match):
original_content = node.text_content()
print("\n-- test case --\n", lxml.html.tostring(node, encoding="unicode"))

check_tags = node.cssselect(".highlight-none")
checks = []
for tag in check_tags:
text = tag.text_content().strip()
# lxml normalizes &nbsp to the unicode \xa0, so we do the same
text = text.replace("&nbsp;", "\xa0")
checks.append(text)
tag.drop_tree()

# make sure we removed the tests from the top-level node, to avoid
# potential false positives matching on the tests themselves!
assert len(node.text_content()) < len(original_content)
assert checks

test_content = lxml.html.tostring(node, encoding="unicode")
# some versions of sphinx (>= 1.6) replace "..." with the ellipsis
# character \u2026. Normalize back to "..." for comparison
# purposes.
test_content = test_content.replace("\u2026", "...")
for check in checks:
try:
if expect_match:
> assert re.search(check, test_content) is not None
E assert None is not None
E + where None = <function search at 0x7f9fa6f3c040>('<em class="property">await </em><code class="(sig-name )?descname">foo</code>', '<div class="admonition note">\n<p class="admonition-title">Note</p>\n<dl class="py function">\n<dt class="sig sig-obj... class="n"><span class="pre">bar</span></span></em><span class="sig-paren">)</span></dt>\n<dd></dd></dl>\n\n\n</div>\n')
E + where <function search at 0x7f9fa6f3c040> = re.search

tests/test_sphinxcontrib_trio.py:220: AssertionError
----------------------------- Captured stdout call -----------------------------
Running Sphinx v4.0.1
making output directory... done
[autosummary] generating autosummary for: test.rst
[autosummary] generating autosummary for: /tmp/pytest-of-builduser/pytest-0/test_end_to_end0/test-docs-source/autodoc_examples.autosummary_me.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [ 50%] autodoc_examples.autosummary_me
reading sources... [100%] test

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [ 50%] autodoc_examples.autosummary_me
writing output... [100%] test

generating indices... genindex py-modindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

The HTML pages are in ../../../../tmp/pytest-of-builduser/pytest-0/test_end_to_end0/out.

-- NEGATIVE (WARNING) TESTS --


-- test case --
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">foo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bar</span></span></em><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;em class="property"&gt;await &lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;foo&lt;/code&gt;
</pre></div>
</div>
</div>


-- test case --
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-prename descclassname"><span class="pre">autodoc_examples.</span></span><span class="sig-name descname"><span class="pre">basic</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;basic&lt;/code&gt;
</pre></div>
</div>
</div>


-- test case --
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<dl class="py class">
<dt class="sig sig-object py">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">autodoc_examples.</span></span><span class="sig-name descname"><span class="pre">ExampleInheritedSubclass</span></span></dt>
<dd><dl class="py method">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">a_syncmethod</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">b_syncmethod</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">c_asyncmethod</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">d_asyncmethod</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

</dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;em class="property"&gt;await &lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;a_syncmethod&lt;/code&gt;
</pre></div>
</div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;em class="property"&gt;await &lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;b_syncmethod&lt;/code&gt;
</pre></div>
</div>
</div>


-- test case --
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-prename descclassname"><span class="pre">autodoc_examples.</span></span><span class="sig-name descname"><span class="pre">gen</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>for
</pre></div>
</div>
</div>


-- POSITIVE (NOTE) TESTS --


-- test case --
<div class="admonition note">
<p class="admonition-title">Note</p>
<dl class="py function">
<dt class="sig sig-object py">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">foo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bar</span></span></em><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;em class="property"&gt;await &lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;foo&lt;/code&gt;
</pre></div>
</div>
</div>

failed check

'<em class="property">await </em><code class="(sig-name )?descname">foo</code>'

failed test_content

'<div class="admonition note">\n<p class="admonition-title">Note</p>\n<dl class="py function">\n<dt class="sig sig-object py">\n<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">foo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bar</span></span></em><span class="sig-paren">)</span></dt>\n<dd></dd></dl>\n\n\n</div>\n'
=============================== warnings summary ===============================
../../../../usr/lib/python3.9/site-packages/packaging/version.py:127: 304 warnings
/usr/lib/python3.9/site-packages/packaging/version.py:127: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_sphinxcontrib_trio.py::test_end_to_end - assert None is not...
================== 1 failed, 2 passed, 304 warnings in 1.90s ===================
==> ERROR: A failure occurred in check().
```
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 24 December 2022, 04:50 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-sphinxcontrib-trio 1.1.2-3

Loading...