File tree Expand file tree Collapse file tree 6 files changed +30
-30
lines changed
tests/functional/ext/docparams/raise Expand file tree Collapse file tree 6 files changed +30
-30
lines changed Original file line number Diff line number Diff line change @@ -17,33 +17,33 @@ def test_find_google_attr_raises_exact_exc(self):
17
17
"""This is a google docstring.
18
18
19
19
Raises:
20
- re.error : Sometimes
20
+ calendar.IllegalMonthError : Sometimes
21
21
"""
22
- import re
22
+ import calendar
23
23
24
- raise re . error ( "hi" )
24
+ raise calendar . IllegalMonthError ( - 1 )
25
25
26
26
27
27
def test_find_google_attr_raises_substr_exc (self ):
28
28
"""This is a google docstring.
29
29
30
30
Raises:
31
- re.error : Sometimes
31
+ calendar.IllegalMonthError : Sometimes
32
32
"""
33
- from re import error
33
+ from calendar import IllegalMonthError
34
34
35
- raise error ( "hi" )
35
+ raise IllegalMonthError ( - 1 )
36
36
37
37
38
38
def test_find_valid_missing_google_attr_raises (self ): # [missing-raises-doc]
39
39
"""This is a google docstring.
40
40
41
41
Raises:
42
- re .anothererror: Sometimes
42
+ calendar .anothererror: Sometimes
43
43
"""
44
- from re import error
44
+ from calendar import IllegalMonthError
45
45
46
- raise error ( "hi" )
46
+ raise IllegalMonthError ( - 1 )
47
47
48
48
49
49
def test_find_invalid_missing_google_attr_raises (self ):
Original file line number Diff line number Diff line change 1
1
missing-raises-doc:6:0:6:35:test_find_missing_google_raises:"""RuntimeError"" not documented as being raised":HIGH
2
2
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
4
4
unreachable:83:4:83:25:test_find_all_google_raises:Unreachable code:HIGH
5
5
unreachable:94:4:94:25:test_find_multiple_google_raises:Unreachable code:HIGH
6
6
unreachable:95:4:95:30:test_find_multiple_google_raises:Unreachable code:HIGH
Original file line number Diff line number Diff line change @@ -87,38 +87,38 @@ def test_find_numpy_attr_raises_exact_exc(self):
87
87
88
88
Raises
89
89
------
90
- re.error
90
+ calendar.IllegalMonthError
91
91
Sometimes
92
92
"""
93
- import re
93
+ import calendar
94
94
95
- raise re . error ( "hi" )
95
+ raise calendar . IllegalMonthError ( - 1 )
96
96
97
97
98
98
def test_find_numpy_attr_raises_substr_exc (self ):
99
99
"""This is a numpy docstring.
100
100
101
101
Raises
102
102
------
103
- re.error
103
+ calendar.IllegalMonthError
104
104
Sometimes
105
105
"""
106
- from re import error
106
+ from calendar import IllegalMonthError
107
107
108
- raise error ( "hi" )
108
+ raise IllegalMonthError ( - 1 )
109
109
110
110
111
111
def test_find_valid_missing_numpy_attr_raises (self ): # [missing-raises-doc]
112
112
"""This is a numpy docstring.
113
113
114
114
Raises
115
115
------
116
- re .anothererror
116
+ calendar .anothererror
117
117
Sometimes
118
118
"""
119
- from re import error
119
+ from calendar import IllegalMonthError
120
120
121
- raise error ( "hi" )
121
+ raise IllegalMonthError ( - 1 )
122
122
123
123
124
124
def test_find_invalid_missing_numpy_attr_raises (self ):
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ unreachable:20:4:20:25:test_find_missing_numpy_raises:Unreachable code:HIGH
3
3
unreachable:34:4:34:25:test_find_all_numpy_raises:Unreachable code:HIGH
4
4
missing-raises-doc:37:0:37:35:test_find_rethrown_numpy_raises:"""RuntimeError"" not documented as being raised":HIGH
5
5
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
7
7
missing-raises-doc:146:4:146:11:Foo.foo:"""AttributeError"" not documented as being raised":HIGH
8
8
unreachable:158:8:158:17:Foo.foo:Unreachable code:HIGH
9
9
unreachable:182:8:182:17:Foo.foo:Unreachable code:HIGH
Original file line number Diff line number Diff line change @@ -123,33 +123,33 @@ def test_find_sphinx_attr_raises_exact_exc(self):
123
123
def test_find_sphinx_attr_raises_substr_exc (self ):
124
124
"""This is a sphinx docstring.
125
125
126
- :raises re.error : Sometimes
126
+ :raises calendar.IllegalMonthError : Sometimes
127
127
"""
128
- from re import error
128
+ from calendar import IllegalMonthError
129
129
130
- raise error ( "hi" )
130
+ raise IllegalMonthError ( - 1 )
131
131
132
132
133
133
def test_find_valid_missing_sphinx_attr_raises (self ): # [missing-raises-doc]
134
134
"""This is a sphinx docstring.
135
135
136
- :raises re .anothererror: Sometimes
136
+ :raises calendar .anothererror: Sometimes
137
137
"""
138
- from re import error
138
+ from calendar import IllegalMonthError
139
139
140
- raise error ( "hi" )
140
+ raise IllegalMonthError ( - 1 )
141
141
142
142
143
143
def test_find_invalid_missing_sphinx_attr_raises (self ):
144
144
"""This is a sphinx docstring.
145
145
pylint allows this to pass since the comparison between Raises and
146
146
raise are based on the class name, not the qualified name.
147
147
148
- :raises bogusmodule.error : Sometimes
148
+ :raises bogusmodule.IllegalMonthError : Sometimes
149
149
"""
150
- from re import error
150
+ from calendar import IllegalMonthError
151
151
152
- raise error ( "hi" )
152
+ raise IllegalMonthError ( - 1 )
153
153
154
154
155
155
class Foo :
Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ missing-raises-doc:90:0:90:55:test_find_missing_sphinx_raises_infer_from_instanc
10
10
unreachable:97:4:97:25:test_find_missing_sphinx_raises_infer_from_instance:Unreachable code:HIGH
11
11
missing-raises-doc:100:0:100:55:test_find_missing_sphinx_raises_infer_from_function:"""RuntimeError"" not documented as being raised":HIGH
12
12
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
You can’t perform that action at this time.
0 commit comments