You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
install .whl file in </install/prefix> using 'installer` module
run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-trio-1.1.2-15.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-trio-1.1.2-15.fc35.x86_64/usr/lib/python3.8/site-packages+ /usr/bin/pytest -ra -m 'not network'==================================================================================== test session starts ====================================================================================platform linux -- Python 3.8.18, pytest-7.4.4, pluggy-1.3.0rootdir: /home/tkloczko/rpmbuild/BUILD/sphinxcontrib-trio-1.1.2plugins: datadir-1.5.0, regressions-2.5.0collected 3 itemstests/test_sphinxcontrib_trio.py .F. [100%]========================================================================================= FAILURES ==========================================================================================______________________________________________________________________________________ test_end_to_end ______________________________________________________________________________________tmpdir = local('/tmp/pytest-of-tkloczko/pytest-69/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   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 0x7f16e2bb8f90> 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   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 NoneE assert None is not NoneE + where None = <function search at 0x7f16e4ed5430>('<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 0x7f16e4ed5430> = re.searchtests/test_sphinxcontrib_trio.py:220: AssertionError----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------Running Sphinx v7.1.2making output directory... donelocale_dir /tmp/pytest-of-tkloczko/pytest-69/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not exists[autosummary] generating autosummary for: test.rst[autosummary] generating autosummary for: /tmp/pytest-of-tkloczko/pytest-69/test_end_to_end0/test-docs-source/autodoc_examples.autosummary_me.rstlocale_dir /tmp/pytest-of-tkloczko/pytest-69/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not existsbuilding [mo]: targets for 0 po files that are out of datewriting output...building [html]: targets for 1 source files that are out of dateupdating environment: locale_dir /tmp/pytest-of-tkloczko/pytest-69/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not exists[new config] 2 added, 0 changed, 0 removedreading sources... [ 50%] autodoc_examples.autosummary_mereading sources... [100%] testlooking for now-outdated files... none foundpickling environment... donechecking consistency... donepreparing documents... donecopying assets... copying static files... donecopying extra files... donedonewriting output... [ 50%] autodoc_examples.autosummary_mewriting output... [100%] testgenerating indices... genindex py-modindex donewriting additional pages... search donedumping search index in English (code: en)... donedumping object inventory... donebuild succeeded.The HTML pages are in ../../../../../tmp/pytest-of-tkloczko/pytest-69/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><em class="property">await </em><code class="(sig-name )?descname">foo</code></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></em><code class="(sig-name )?descname">basic</code></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><span class="w"> </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><em class="property">await </em><code class="(sig-name )?descname">a_syncmethod</code></pre></div></div><div class="highlight-none notranslate"><div class="highlight"><pre><span></span><em class="property">await </em><code class="(sig-name )?descname">b_syncmethod</code></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><em class="property">await </em><code class="(sig-name )?descname">foo</code></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'================================================================================== short test summary info ==================================================================================FAILED tests/test_sphinxcontrib_trio.py::test_end_to_end - assert None is not None================================================================================ 1 failed, 2 passed in 2.51s ================================================================================
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
List of installed modules in build env:
Please let me know if you need more details or want me to perform some diagnostics.
The text was updated successfully, but these errors were encountered: