============================= test session starts ============================== platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-0.13.1 rootdir: /build/python-pdoc/src/pdoc-7.4.0, configfile: tox.ini, testpaths: test plugins: hypothesis-6.17.0, timeout-1.4.2 timeout: 120.0s timeout method: signal timeout func_only: False collected 316 items / 1 deselected / 315 selected test/test_doc.py ........ [ 2%] test/test_doc_ast.py ..... [ 4%] test/test_doc_types.py F.... [ 5%] test/test_docstrings.py .... [ 6%] test/test_extract.py ..... [ 8%] test/test_main.py .... [ 9%] test/test_render_helpers.py ............... [ 14%] test/test_search.py . [ 14%] test/test_smoke.py ..................................................... [ 31%] ........................................................................ [ 54%] ........................................................................ [ 77%] ........................F..... [ 86%] test/test_snapshot.py ........F...............F........ [ 97%] test/test_web.py ........ [100%] =================================== FAILURES =================================== _____________________ test_formatannotation_still_unfixed ______________________ @pytest.mark.skipif(sys.version_info < (3, 9), reason="3.9+ only") def test_formatannotation_still_unfixed(): """when this tests starts to fail, we can remove the workaround in our formatannotation wrapper""" assert formatannotation(list[str]) == "list[str]" > assert inspect.formatannotation(list[str]) == "list" E AssertionError: assert 'list[str]' == 'list' E - list E + list[str] test/test_doc_types.py:14: AssertionError ____________________________ test_smoke[pyparsing] _____________________________ module = 'pyparsing' @pytest.mark.slow @pytest.mark.filterwarnings("ignore") @pytest.mark.parametrize("module", modules) def test_smoke(module): try: with pdoc.extract.mock_some_common_side_effects(): importlib.import_module(module) except pdoc.extract.AnyException: pass else: # noinspection PyTypeChecker pdoc.pdoc(module, format="repr") > pdoc.pdoc(module, format="html") test/test_smoke.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pdoc/__init__.py:424: in pdoc write(doc_objects[module]) pdoc/__init__.py:396: in write retval.write(r(mod)) pdoc/__init__.py:404: in r return render.html_module(module=mod, all_modules=all_modules) pdoc/render.py:91: in html_module return env.get_template("module.html.jinja2").render( /usr/lib/python3.10/site-packages/jinja2/environment.py:1289: in render return concat(self.root_render_func(ctx)) # type: ignore pdoc/templates/default/module.html.jinja2:1022: in root ??? pdoc/templates/default/frame.html.jinja2:22: in root ??? pdoc/templates/default/module.html.jinja2:1133: in block_body ??? pdoc/templates/default/module.html.jinja2:1419: in block_module_contents ??? /usr/lib/python3.10/site-packages/jinja2/runtime.py:349: in call return __obj(*args, **kwargs) /usr/lib/python3.10/site-packages/jinja2/runtime.py:814: in __call__ return self._invoke(arguments, autoescape) /usr/lib/python3.10/site-packages/jinja2/runtime.py:828: in _invoke rv = self._func(*arguments) pdoc/templates/default/module.html.jinja2:566: in macro {#- no space -#} /usr/lib/python3.10/site-packages/jinja2/runtime.py:349: in call return __obj(*args, **kwargs) /usr/lib/python3.10/site-packages/jinja2/runtime.py:814: in __call__ return self._invoke(arguments, autoescape) /usr/lib/python3.10/site-packages/jinja2/runtime.py:828: in _invoke rv = self._func(*arguments) pdoc/templates/default/module.html.jinja2:598: in macro {% elif doc.type == "module" %} pdoc/render_helpers.py:68: in to_html return pdoc.markdown2.markdown(docstring, extras=markdown_extensions) # type: ignore pdoc/markdown2/__init__.py:189: in markdown use_file_vars=use_file_vars, cli=cli).convert(text) pdoc/markdown2/__init__.py:382: in convert text = self._run_block_gamut(text) pdoc/markdown2/__init__.py:1022: in _run_block_gamut text = self._do_code_blocks(text) pdoc/markdown2/__init__.py:1933: in _do_code_blocks return code_block_re.sub(self._code_block_sub, text) pdoc/markdown2/__init__.py:1891: in _code_block_sub codeblock = self._encode_code(codeblock) pdoc/markdown2/__init__.py:2012: in _encode_code hashed = _hash_text(text) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ s = 'ident = Word(alphas, alphanums)\nnum = Word(nums)\nfunc = Forward()\nterm = ident | num | Group(\'(\' + func + \')\')... Group(Optional(delimitedList(term)))\nresult = func.parseString("fna a,b,(fnb c,d,200),100")\nresult.pprint(width=40)' def _hash_text(s): > return 'md5-' + sha256(SECRET_SALT + s.encode("utf-8")).hexdigest()[32:] E Failed: Timeout >120.0s pdoc/markdown2/__init__.py:146: Failed ________________________ test_snapshots[html-snapshot8] ________________________ snapshot = Snapshot(demo_eager), format = 'html' @pytest.mark.parametrize("snapshot", snapshots) @pytest.mark.parametrize("format", ["html", "repr"]) def test_snapshots(snapshot: Snapshot, format: str): """ Compare pdoc's rendered output against stored snapshots. """ if sys.version_info < snapshot.min_version: pytest.skip( f"Snapshot only works on Python {'.'.join(str(x) for x in snapshot.min_version)} and above." ) expected = snapshot.outfile(format).read_text("utf8") actual = snapshot.make(format) > assert actual == expected, ( f"Rendered output does not match for snapshot {snapshot.id}. " "Run `python3 ./test/test_snapshot.py` to update snapshots." ) E AssertionError: Rendered output does not match for snapshot demo_eager. Run `python3 ./test/test_snapshot.py` to update snapshots. E assert '\n' == '\n' E Skipping 28537 identical leading characters in diff, use -v to show E - ">(x: list, /) -> List[int]: E + ">(x: list[int], /) -> List[int]: E ? +++++ E E E
... E E ...Full output truncated (14 lines hidden), use '-vv' to show test/test_snapshot.py:143: AssertionError ________________________ test_snapshots[repr-snapshot8] ________________________ snapshot = Snapshot(demo_eager), format = 'repr' @pytest.mark.parametrize("snapshot", snapshots) @pytest.mark.parametrize("format", ["html", "repr"]) def test_snapshots(snapshot: Snapshot, format: str): """ Compare pdoc's rendered output against stored snapshots. """ if sys.version_info < snapshot.min_version: pytest.skip( f"Snapshot only works on Python {'.'.join(str(x) for x in snapshot.min_version)} and above." ) expected = snapshot.outfile(format).read_text("utf8") actual = snapshot.make(format) > assert actual == expected, ( f"Rendered output does not match for snapshot {snapshot.id}. " "Run `python3 ./test/test_snapshot.py` to update snapshots." ) E AssertionError: Rendered output does not match for snapshot demo_eager. Run `python3 ./test/test_snapshot.py` to update snapshots. E assert '>' == '>' E Skipping 107 identical leading characters in diff, use -v to show E - ar(x: list, /) -> List[int]: ...>> E + ar(x: list[int], /) -> List[int]: ...>> E ? +++++ test/test_snapshot.py:143: AssertionError =========================== short test summary info ============================ FAILED test/test_doc_types.py::test_formatannotation_still_unfixed - Assertio... FAILED test/test_smoke.py::test_smoke[pyparsing] - Failed: Timeout >120.0s FAILED test/test_snapshot.py::test_snapshots[html-snapshot8] - AssertionError... FAILED test/test_snapshot.py::test_snapshots[repr-snapshot8] - AssertionError... =========== 4 failed, 311 passed, 1 deselected in 777.22s (0:12:57) ============ ==> ERROR: A failure occurred in check().  Aborting...