diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-17 19:12:56 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-17 19:12:56 +0900 |
commit | 3c7d35d2a20cfa7c915538704680a33db87c0563 (patch) | |
tree | 5c8e1c9e894f90bf18d77c324ab7829fe0c784a6 /tests/test_domain_py.py | |
parent | 4ad466c7a602ca3b60a9cee15a07f84903a28fe8 (diff) | |
parent | 5f51a1e63f9442439466b7acede87ad21d49bdc0 (diff) | |
download | sphinx-git-3c7d35d2a20cfa7c915538704680a33db87c0563.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r-- | tests/test_domain_py.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index 6f91323a6..653ab1cd4 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -40,22 +40,22 @@ def parse(sig): def test_function_signatures(): rv = parse('func(a=1) -> int object') - assert rv == 'a=1' + assert rv == '(a=1)' rv = parse('func(a=1, [b=None])') - assert rv == 'a=1, [b=None]' + assert rv == '(a=1, [b=None])' rv = parse('func(a=1[, b=None])') - assert rv == 'a=1, [b=None]' + assert rv == '(a=1, [b=None])' rv = parse("compile(source : string, filename, symbol='file')") - assert rv == "source : string, filename, symbol='file'" + assert rv == "(source : string, filename, symbol='file')" rv = parse('func(a=[], [b=None])') - assert rv == 'a=[], [b=None]' + assert rv == '(a=[], [b=None])' rv = parse('func(a=[][, b=None])') - assert rv == 'a=[], [b=None]' + assert rv == '(a=[], [b=None])' @pytest.mark.sphinx('dummy', testroot='domain-py') @@ -422,7 +422,8 @@ def test_pydata_signature(app): doctree = restructuredtext.parse(app, text) assert_node(doctree, (addnodes.index, [desc, ([desc_signature, ([desc_name, "version"], - [desc_annotation, ": int"], + [desc_annotation, (": ", + [pending_xref, "int"])], [desc_annotation, " = 1"])], desc_content)])) assert_node(doctree[1], addnodes.desc, desctype="data", @@ -454,8 +455,8 @@ def test_pyobject_prefix(app): desc, addnodes.index, desc)])])) - assert doctree[1][1][1].astext().strip() == 'say' # prefix is stripped - assert doctree[1][1][3].astext().strip() == 'FooBar.say' # not stripped + assert doctree[1][1][1].astext().strip() == 'say()' # prefix is stripped + assert doctree[1][1][3].astext().strip() == 'FooBar.say()' # not stripped def test_pydata(app): @@ -692,7 +693,8 @@ def test_pyattribute(app): assert_node(doctree[1][1][0], addnodes.index, entries=[('single', 'attr (Class attribute)', 'Class.attr', '', None)]) assert_node(doctree[1][1][1], ([desc_signature, ([desc_name, "attr"], - [desc_annotation, ": str"], + [desc_annotation, (": ", + [pending_xref, "str"])], [desc_annotation, " = ''"])], [desc_content, ()])) assert 'Class.attr' in domain.objects |