summaryrefslogtreecommitdiff
path: root/tests/extensions/test_check_raise_docs.py
diff options
context:
space:
mode:
authorDanny Hermes <daniel.j.hermes@gmail.com>2019-08-16 08:15:43 -0700
committerClaudiu Popa <pcmanticore@gmail.com>2019-08-16 17:15:43 +0200
commit7100b3949fbf8bf76549876ff8e1f296bc13eed7 (patch)
tree050467cd29744aeee07e2df15484706dcd80847c /tests/extensions/test_check_raise_docs.py
parenta6b1e810df608430b04b65ad1ddc9ba1b8a22c89 (diff)
downloadpylint-git-7100b3949fbf8bf76549876ff8e1f296bc13eed7.tar.gz
Allow a `.` as a prefix for Sphinx name resolution. (#3058)
For context see https://github.com/PyCQA/pylint/issues/1502#issuecomment-448535694 In this issue it was agreed that `re.error`, `~re.error` and `!re.error` would all be accepted. However, it's also common in Sphinx to use a `.` prefix for local references.
Diffstat (limited to 'tests/extensions/test_check_raise_docs.py')
-rw-r--r--tests/extensions/test_check_raise_docs.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/extensions/test_check_raise_docs.py b/tests/extensions/test_check_raise_docs.py
index c2d7556a4..07f1f567f 100644
--- a/tests/extensions/test_check_raise_docs.py
+++ b/tests/extensions/test_check_raise_docs.py
@@ -167,6 +167,24 @@ class TestDocstringCheckerRaise(CheckerTestCase):
with self.assertNoMessages():
self.checker.visit_raise(raise_node)
+ def test_google_raises_local_reference(self):
+ raise_node = astroid.extract_node(
+ '''
+ def my_func(self):
+ """This is a google docstring.
+
+ Raises:
+ .LocalException: Always
+ """
+ from neighbor_module import LocalException
+ raise LocalException('hi') #@
+ '''
+ )
+ # pylint allows this to pass since the comparison between Raises and
+ # raise are based on the class name, not the qualified name.
+ with self.assertNoMessages():
+ self.checker.visit_raise(raise_node)
+
@set_config(accept_no_raise_doc=False)
def test_google_raises_with_prefix(self):
code_snippet = '''