From 1f6a92188178c535cf46e21c22aec65e84234667 Mon Sep 17 00:00:00 2001 From: Philipp A Date: Tue, 13 Jul 2021 12:57:34 +0200 Subject: [PATCH] Sphinx 4.1 fixes (#36) --- scanpydoc/definition_list_typed_field.py | 3 ++- tests/test_elegant_typehints.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scanpydoc/definition_list_typed_field.py b/scanpydoc/definition_list_typed_field.py index c3065d0..9b36ffb 100644 --- a/scanpydoc/definition_list_typed_field.py +++ b/scanpydoc/definition_list_typed_field.py @@ -34,11 +34,12 @@ def make_field( domain: str, items: Tuple[str, List[nodes.inline]], env: BuildEnvironment = None, + **kw, ) -> nodes.field: """Render a field to a document-tree node representing a definition list item.""" def make_refs(role_name, name, node): - return self.make_xrefs(role_name, domain, name, node, env=env) + return self.make_xrefs(role_name, domain, name, node, env=env, **kw) def handle_item( fieldarg: str, content: List[nodes.inline] diff --git a/tests/test_elegant_typehints.py b/tests/test_elegant_typehints.py index 2d5f101..d97b4ab 100644 --- a/tests/test_elegant_typehints.py +++ b/tests/test_elegant_typehints.py @@ -268,8 +268,8 @@ def test_autodoc(app, _testmod, direc, base, sub): out = Path(app.outdir, "index.html").read_text() assert not app._warning.getvalue(), app._warning.getvalue() assert re.search( - r']*>test\.' - f']*>{sub}', + r'<(code|span)?[^>]*>test\.' + f'<(code|span)?[^>]*>{sub}', out, ), out assert f'