diff --git a/tests/roots/test-domain-py/module.rst b/tests/roots/test-domain-py/module.rst index c01032b26..dce3fa5ac 100644 --- a/tests/roots/test-domain-py/module.rst +++ b/tests/roots/test-domain-py/module.rst @@ -51,3 +51,11 @@ module .. py:attribute:: attr2 :type: :doc:`index` + +.. py:module:: exceptions + +.. py:exception:: Exception + +.. py:module:: object + +.. py:function:: sum() diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index 218ded510..8d6d43b48 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -206,6 +206,18 @@ def test_domain_py_find_obj(app, status, warning): [('NestedParentA.NestedChildA.subchild_1', ('roles', 'nestedparenta-nestedchilda-subchild-1', 'method'))]) + # special case: exceptions + assert (find_obj('exceptions', None, 'Exception', 'exc') == + [('exceptions.Exception', ('module', 'exceptions-exception', 'exception'))]) + assert (find_obj(None, None, 'Exception', 'exc') == + [('exceptions.Exception', ('module', 'exceptions-exception', 'exception'))]) + + # special case: object + assert (find_obj('object', None, 'sum', 'func') == + [('object.sum', ('module', 'object-sum', 'function'))]) + assert (find_obj(None, None, 'sum', 'func') == + [('object.sum', ('module', 'object-sum', 'function'))]) + def test_get_full_qualified_name(): env = Mock(domaindata={})