Skip to content

Commit 94f7e3b

Browse files
[PY313] Use error that hasn't been renamed in docparams tests
1 parent f7a928c commit 94f7e3b

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

tests/functional/ext/docparams/raise/missing_raises_doc_Google.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ def test_find_google_attr_raises_exact_exc(self):
1717
"""This is a google docstring.
1818
1919
Raises:
20-
re.error: Sometimes
20+
calendar.IllegalMonthError: Sometimes
2121
"""
22-
import re
22+
import calendar
2323

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

2626

2727
def test_find_google_attr_raises_substr_exc(self):
2828
"""This is a google docstring.
2929
3030
Raises:
31-
re.error: Sometimes
31+
calendar.IllegalMonthError: Sometimes
3232
"""
33-
from re import error
33+
from calendar import IllegalMonthError
3434

35-
raise error("hi")
35+
raise IllegalMonthError(-1)
3636

3737

3838
def test_find_valid_missing_google_attr_raises(self): # [missing-raises-doc]
3939
"""This is a google docstring.
4040
4141
Raises:
42-
re.anothererror: Sometimes
42+
calendar.anothererror: Sometimes
4343
"""
44-
from re import error
44+
from calendar import IllegalMonthError
4545

46-
raise error("hi")
46+
raise IllegalMonthError(-1)
4747

4848

4949
def test_find_invalid_missing_google_attr_raises(self):

tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
missing-raises-doc:6:0:6:35:test_find_missing_google_raises:"""RuntimeError"" not documented as being raised":HIGH
22
unreachable:13:4:13:25:test_find_missing_google_raises:Unreachable code:HIGH
3-
missing-raises-doc:38:0:38:46:test_find_valid_missing_google_attr_raises:"""PatternError"" not documented as being raised":HIGH
3+
missing-raises-doc:38:0:38:46:test_find_valid_missing_google_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH
44
unreachable:83:4:83:25:test_find_all_google_raises:Unreachable code:HIGH
55
unreachable:94:4:94:25:test_find_multiple_google_raises:Unreachable code:HIGH
66
unreachable:95:4:95:30:test_find_multiple_google_raises:Unreachable code:HIGH

tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,38 +87,38 @@ def test_find_numpy_attr_raises_exact_exc(self):
8787
8888
Raises
8989
------
90-
re.error
90+
calendar.IllegalMonthError
9191
Sometimes
9292
"""
93-
import re
93+
import calendar
9494

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

9797

9898
def test_find_numpy_attr_raises_substr_exc(self):
9999
"""This is a numpy docstring.
100100
101101
Raises
102102
------
103-
re.error
103+
calendar.IllegalMonthError
104104
Sometimes
105105
"""
106-
from re import error
106+
from calendar import IllegalMonthError
107107

108-
raise error("hi")
108+
raise IllegalMonthError(-1)
109109

110110

111111
def test_find_valid_missing_numpy_attr_raises(self): # [missing-raises-doc]
112112
"""This is a numpy docstring.
113113
114114
Raises
115115
------
116-
re.anothererror
116+
calendar.anothererror
117117
Sometimes
118118
"""
119-
from re import error
119+
from calendar import IllegalMonthError
120120

121-
raise error("hi")
121+
raise IllegalMonthError(-1)
122122

123123

124124
def test_find_invalid_missing_numpy_attr_raises(self):

tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ unreachable:20:4:20:25:test_find_missing_numpy_raises:Unreachable code:HIGH
33
unreachable:34:4:34:25:test_find_all_numpy_raises:Unreachable code:HIGH
44
missing-raises-doc:37:0:37:35:test_find_rethrown_numpy_raises:"""RuntimeError"" not documented as being raised":HIGH
55
missing-raises-doc:53:0:53:44:test_find_rethrown_numpy_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":HIGH
6-
missing-raises-doc:111:0:111:45:test_find_valid_missing_numpy_attr_raises:"""PatternError"" not documented as being raised":HIGH
6+
missing-raises-doc:111:0:111:45:test_find_valid_missing_numpy_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH
77
missing-raises-doc:146:4:146:11:Foo.foo:"""AttributeError"" not documented as being raised":HIGH
88
unreachable:158:8:158:17:Foo.foo:Unreachable code:HIGH
99
unreachable:182:8:182:17:Foo.foo:Unreachable code:HIGH

tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,33 +123,33 @@ def test_find_sphinx_attr_raises_exact_exc(self):
123123
def test_find_sphinx_attr_raises_substr_exc(self):
124124
"""This is a sphinx docstring.
125125
126-
:raises re.error: Sometimes
126+
:raises calendar.IllegalMonthError: Sometimes
127127
"""
128-
from re import error
128+
from calendar import IllegalMonthError
129129

130-
raise error("hi")
130+
raise IllegalMonthError(-1)
131131

132132

133133
def test_find_valid_missing_sphinx_attr_raises(self): # [missing-raises-doc]
134134
"""This is a sphinx docstring.
135135
136-
:raises re.anothererror: Sometimes
136+
:raises calendar.anothererror: Sometimes
137137
"""
138-
from re import error
138+
from calendar import IllegalMonthError
139139

140-
raise error("hi")
140+
raise IllegalMonthError(-1)
141141

142142

143143
def test_find_invalid_missing_sphinx_attr_raises(self):
144144
"""This is a sphinx docstring.
145145
pylint allows this to pass since the comparison between Raises and
146146
raise are based on the class name, not the qualified name.
147147
148-
:raises bogusmodule.error: Sometimes
148+
:raises bogusmodule.IllegalMonthError: Sometimes
149149
"""
150-
from re import error
150+
from calendar import IllegalMonthError
151151

152-
raise error("hi")
152+
raise IllegalMonthError(-1)
153153

154154

155155
class Foo:

tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ missing-raises-doc:90:0:90:55:test_find_missing_sphinx_raises_infer_from_instanc
1010
unreachable:97:4:97:25:test_find_missing_sphinx_raises_infer_from_instance:Unreachable code:HIGH
1111
missing-raises-doc:100:0:100:55:test_find_missing_sphinx_raises_infer_from_function:"""RuntimeError"" not documented as being raised":HIGH
1212
unreachable:110:4:110:25:test_find_missing_sphinx_raises_infer_from_function:Unreachable code:HIGH
13-
missing-raises-doc:133:0:133:46:test_find_valid_missing_sphinx_attr_raises:"""PatternError"" not documented as being raised":HIGH
13+
missing-raises-doc:133:0:133:46:test_find_valid_missing_sphinx_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH

0 commit comments

Comments
 (0)