diff options
author | kasium <15907922+kasium@users.noreply.github.com> | 2021-12-15 00:19:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 00:19:44 +0100 |
commit | 26c9042825a6549c9f889b2cd17b5e08ba784ab2 (patch) | |
tree | 27973a03c916fc438402e0631f5d52be1ef49ae5 /doc/whatsnew/2.13.rst | |
parent | af8cc2e75018d34fbbed08d4bfa3380e80f89b4d (diff) | |
download | pylint-git-26c9042825a6549c9f889b2cd17b5e08ba784ab2.tar.gz |
Enable missing-raises-doc to understand class hierarchies (#5278)
Before, missing-raises-doc could not understand class hierarchies but just compared names.
So, when a method documented a raise of a parent class, but a child exception was raised, the check failed.
With this change, if the name compare doesn't help, the exception class hierarchy is checked.
For that, possible_exc_types was changed to return classes instead of names
Resolved #4955
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'doc/whatsnew/2.13.rst')
-rw-r--r-- | doc/whatsnew/2.13.rst | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 9c7d93d2c..da595d225 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -80,3 +80,17 @@ Other Changes * The ``testutils`` for unittests now accept ``end_lineno`` and ``end_column``. Tests without these will trigger a ``DeprecationWarning``. + +* ``missing-raises-doc`` will now check the class hierarchy of the raised exceptions + + .. code-block:: python + + def my_function() + """My function. + + Raises: + Exception: if something fails + """ + raise ValueError + + Closes #4955 |