Skip to content

Commit

Permalink
[PY313] Use error that hasn't been renamed in docparams tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Aug 9, 2024
1 parent ca4f48e commit bf33b6e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@ def test_find_google_attr_raises_exact_exc(self):
"""This is a google docstring.
Raises:
re.error: Sometimes
calendar.IllegalMonthError: Sometimes
"""
import re
import calendar

raise re.error("hi")
raise calendar.IllegalMonthError(-1)


def test_find_google_attr_raises_substr_exc(self):
"""This is a google docstring.
Raises:
re.error: Sometimes
calendar.IllegalMonthError: Sometimes
"""
from re import error
from calendar import IllegalMonthError

raise error("hi")
raise IllegalMonthError(-1)


def test_find_valid_missing_google_attr_raises(self): # [missing-raises-doc]
"""This is a google docstring.
Raises:
re.anothererror: Sometimes
calendar.anothererror: Sometimes
"""
from re import error
from calendar import IllegalMonthError

raise error("hi")
raise IllegalMonthError(-1)


def test_find_invalid_missing_google_attr_raises(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
missing-raises-doc:6:0:6:35:test_find_missing_google_raises:"""RuntimeError"" not documented as being raised":HIGH
unreachable:13:4:13:25:test_find_missing_google_raises:Unreachable code:HIGH
missing-raises-doc:38:0:38:46:test_find_valid_missing_google_attr_raises:"""PatternError"" not documented as being raised":HIGH
missing-raises-doc:38:0:38:46:test_find_valid_missing_google_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH
unreachable:83:4:83:25:test_find_all_google_raises:Unreachable code:HIGH
unreachable:94:4:94:25:test_find_multiple_google_raises:Unreachable code:HIGH
unreachable:95:4:95:30:test_find_multiple_google_raises:Unreachable code:HIGH
Expand Down
18 changes: 9 additions & 9 deletions tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,38 +87,38 @@ def test_find_numpy_attr_raises_exact_exc(self):
Raises
------
re.error
calendar.IllegalMonthError
Sometimes
"""
import re
import calendar

raise re.error("hi")
raise calendar.IllegalMonthError(-1)


def test_find_numpy_attr_raises_substr_exc(self):
"""This is a numpy docstring.
Raises
------
re.error
calendar.IllegalMonthError
Sometimes
"""
from re import error
from calendar import IllegalMonthError

raise error("hi")
raise IllegalMonthError(-1)


def test_find_valid_missing_numpy_attr_raises(self): # [missing-raises-doc]
"""This is a numpy docstring.
Raises
------
re.anothererror
calendar.anothererror
Sometimes
"""
from re import error
from calendar import IllegalMonthError

raise error("hi")
raise IllegalMonthError(-1)


def test_find_invalid_missing_numpy_attr_raises(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ unreachable:20:4:20:25:test_find_missing_numpy_raises:Unreachable code:HIGH
unreachable:34:4:34:25:test_find_all_numpy_raises:Unreachable code:HIGH
missing-raises-doc:37:0:37:35:test_find_rethrown_numpy_raises:"""RuntimeError"" not documented as being raised":HIGH
missing-raises-doc:53:0:53:44:test_find_rethrown_numpy_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":HIGH
missing-raises-doc:111:0:111:45:test_find_valid_missing_numpy_attr_raises:"""PatternError"" not documented as being raised":HIGH
missing-raises-doc:111:0:111:45:test_find_valid_missing_numpy_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH
missing-raises-doc:146:4:146:11:Foo.foo:"""AttributeError"" not documented as being raised":HIGH
unreachable:158:8:158:17:Foo.foo:Unreachable code:HIGH
unreachable:182:8:182:17:Foo.foo:Unreachable code:HIGH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,33 +123,33 @@ def test_find_sphinx_attr_raises_exact_exc(self):
def test_find_sphinx_attr_raises_substr_exc(self):
"""This is a sphinx docstring.
:raises re.error: Sometimes
:raises calendar.IllegalMonthError: Sometimes
"""
from re import error
from calendar import IllegalMonthError

raise error("hi")
raise IllegalMonthError(-1)


def test_find_valid_missing_sphinx_attr_raises(self): # [missing-raises-doc]
"""This is a sphinx docstring.
:raises re.anothererror: Sometimes
:raises calendar.anothererror: Sometimes
"""
from re import error
from calendar import IllegalMonthError

raise error("hi")
raise IllegalMonthError(-1)


def test_find_invalid_missing_sphinx_attr_raises(self):
"""This is a sphinx docstring.
pylint allows this to pass since the comparison between Raises and
raise are based on the class name, not the qualified name.
:raises bogusmodule.error: Sometimes
:raises bogusmodule.IllegalMonthError: Sometimes
"""
from re import error
from calendar import IllegalMonthError

raise error("hi")
raise IllegalMonthError(-1)


class Foo:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ missing-raises-doc:90:0:90:55:test_find_missing_sphinx_raises_infer_from_instanc
unreachable:97:4:97:25:test_find_missing_sphinx_raises_infer_from_instance:Unreachable code:HIGH
missing-raises-doc:100:0:100:55:test_find_missing_sphinx_raises_infer_from_function:"""RuntimeError"" not documented as being raised":HIGH
unreachable:110:4:110:25:test_find_missing_sphinx_raises_infer_from_function:Unreachable code:HIGH
missing-raises-doc:133:0:133:46:test_find_valid_missing_sphinx_attr_raises:"""PatternError"" not documented as being raised":HIGH
missing-raises-doc:133:0:133:46:test_find_valid_missing_sphinx_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH

0 comments on commit bf33b6e

Please sign in to comment.