diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-11-21 01:01:36 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-11-21 01:01:36 +0900 |
commit | 3a4ae2092a6f236e2d71fdedb4b66f594e30d4e7 (patch) | |
tree | afa4f774e0f8660d5ce247f01cace9deaa848d58 /tests/test_domain_c.py | |
parent | f3a6004f822b05e352372a77f449332ad230d21e (diff) | |
parent | 18b2707b2ac621f23f8ee6a7ca19bf1590be7826 (diff) | |
download | sphinx-git-3a4ae2092a6f236e2d71fdedb4b66f594e30d4e7.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'tests/test_domain_c.py')
-rw-r--r-- | tests/test_domain_c.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/test_domain_c.py b/tests/test_domain_c.py index 57a7c49e6..28e74e7bf 100644 --- a/tests/test_domain_c.py +++ b/tests/test_domain_c.py @@ -75,12 +75,12 @@ def _check(name, input, idDict, output, key, asTextOutput): idExpected.append(idExpected[i - 1]) idActual = [None] for i in range(1, _max_id + 1): - #try: + # try: id = ast.get_id(version=i) assert id is not None idActual.append(id[len(_id_prefix[i]):]) - #except NoOldIdError: - # idActual.append(None) + # except NoOldIdError: + # idActual.append(None) res = [True] for i in range(1, _max_id + 1): @@ -94,7 +94,7 @@ def _check(name, input, idDict, output, key, asTextOutput): print("Error in id version %d." % i) print("result: %s" % idActual[i]) print("expected: %s" % idExpected[i]) - #print(rootSymbol.dump(0)) + # print(rootSymbol.dump(0)) raise DefinitionError("") @@ -106,7 +106,7 @@ def check(name, input, idDict, output=None, key=None, asTextOutput=None): if name != 'macro': # Second, check with semicolon _check(name, input + ' ;', idDict, output + ';', key, - asTextOutput + ';' if asTextOutput is not None else None) + asTextOutput + ';' if asTextOutput is not None else None) def test_expressions(): @@ -422,7 +422,7 @@ def test_nested_name(): check('function', 'void f(.A.B a)', {1: "f"}) -def test_union_definitions(): +def test_struct_definitions(): check('struct', '{key}A', {1: 'A'}) @@ -482,7 +482,7 @@ def test_attributes(): # style: user-defined paren check('member', 'paren_attr() int f', {1: 'f'}) check('member', 'paren_attr(a) int f', {1: 'f'}) - check('member', 'paren_attr("") int f',{1: 'f'}) + check('member', 'paren_attr("") int f', {1: 'f'}) check('member', 'paren_attr(()[{}][]{}) int f', {1: 'f'}) with pytest.raises(DefinitionError): parse('member', 'paren_attr(() int f') @@ -521,7 +521,7 @@ def test_attributes(): def filter_warnings(warning, file): - lines = warning.getvalue().split("\n"); + lines = warning.getvalue().split("\n") res = [l for l in lines if "domain-c" in l and "{}.rst".format(file) in l and "WARNING: document isn't included in any toctree" not in l] print("Filtered warnings for file '{}':".format(file)) @@ -602,6 +602,7 @@ def _get_obj(app, queryName): return (docname, anchor, objectType) return (queryName, "not", "found") + def test_cfunction(app): text = (".. c:function:: PyObject* " "PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)") |