]> git.madduck.net Git - etc/vim.git/blob - tests/data/comments7.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix feature detection for positional-only arguments in lambdas (#2532)
[etc/vim.git] / tests / data / comments7.py
1 from .config import (
2     Any,
3     Bool,
4     ConfigType,
5     ConfigTypeAttributes,
6     Int,
7     Path,
8     #  String,
9     #  resolve_to_config_type,
10     #  DEFAULT_TYPE_ATTRIBUTES,
11 )
12
13
14 from .config import (
15     Any,
16     Bool,
17     ConfigType,
18     ConfigTypeAttributes,
19     Int,
20     no_comma_here_yet
21     #  and some comments,
22     #  resolve_to_config_type,
23     #  DEFAULT_TYPE_ATTRIBUTES,
24 )
25 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
26     MyLovelyCompanyTeamProjectComponent  # NOT DRY
27 )
28 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
29     MyLovelyCompanyTeamProjectComponent as component  # DRY
30 )
31
32
33 result = 1  # look ma, no comment migration xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
34
35 result = (
36     1  # look ma, no comment migration xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
37 )
38
39 result = (
40     "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  # aaa
41 )
42
43 result = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  # aaa
44
45
46 def func():
47     c = call(
48         0.0123,
49         0.0456,
50         0.0789,
51         0.0123,
52         0.0789,
53         a[-1],  # type: ignore
54     )
55     c = call(
56         0.0123,
57         0.0456,
58         0.0789,
59         0.0123,
60         0.0789,
61         a[-1]  # type: ignore
62     )
63     c = call(
64         0.0123,
65         0.0456,
66         0.0789,
67         0.0123,
68         0.0456,
69         0.0789,
70         0.0123,
71         0.0456,
72         0.0789,
73         a[-1]  # type: ignore
74     )
75
76     # The type: ignore exception only applies to line length, not
77     # other types of formatting.
78     c = call(
79         "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa",  # type: ignore
80         "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa"
81     )
82
83
84 class C:
85     @pytest.mark.parametrize(
86         ("post_data", "message"),
87         [
88             # metadata_version errors.
89             (
90                 {},
91                 "None is an invalid value for Metadata-Version. Error: This field is"
92                 " required. see"
93                 " https://packaging.python.org/specifications/core-metadata"
94             ),
95             (
96                 {"metadata_version": "-1"},
97                 "'-1' is an invalid value for Metadata-Version. Error: Unknown Metadata"
98                 " Version see"
99                 " https://packaging.python.org/specifications/core-metadata"
100             ),
101             # name errors.
102             (
103                 {"metadata_version": "1.2"},
104                 "'' is an invalid value for Name. Error: This field is required. see"
105                 " https://packaging.python.org/specifications/core-metadata"
106             ),
107             (
108                 {"metadata_version": "1.2", "name": "foo-"},
109                 "'foo-' is an invalid value for Name. Error: Must start and end with a"
110                 " letter or numeral and contain only ascii numeric and '.', '_' and"
111                 " '-'. see https://packaging.python.org/specifications/core-metadata"
112             ),
113             # version errors.
114             (
115                 {"metadata_version": "1.2", "name": "example"},
116                 "'' is an invalid value for Version. Error: This field is required. see"
117                 " https://packaging.python.org/specifications/core-metadata"
118             ),
119             (
120                 {"metadata_version": "1.2", "name": "example", "version": "dog"},
121                 "'dog' is an invalid value for Version. Error: Must start and end with"
122                 " a letter or numeral and contain only ascii numeric and '.', '_' and"
123                 " '-'. see https://packaging.python.org/specifications/core-metadata"
124             )
125         ]
126     )
127     def test_fails_invalid_post_data(
128         self, pyramid_config, db_request, post_data, message
129     ):
130         ...
131
132 square = Square(4) # type: Optional[Square]
133
134 # output
135
136 from .config import (
137     Any,
138     Bool,
139     ConfigType,
140     ConfigTypeAttributes,
141     Int,
142     Path,
143     #  String,
144     #  resolve_to_config_type,
145     #  DEFAULT_TYPE_ATTRIBUTES,
146 )
147
148
149 from .config import (
150     Any,
151     Bool,
152     ConfigType,
153     ConfigTypeAttributes,
154     Int,
155     no_comma_here_yet,
156     #  and some comments,
157     #  resolve_to_config_type,
158     #  DEFAULT_TYPE_ATTRIBUTES,
159 )
160 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
161     MyLovelyCompanyTeamProjectComponent,  # NOT DRY
162 )
163 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
164     MyLovelyCompanyTeamProjectComponent as component,  # DRY
165 )
166
167
168 result = 1  # look ma, no comment migration xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
169
170 result = 1  # look ma, no comment migration xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
171
172 result = (  # aaa
173     "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
174 )
175
176 result = (  # aaa
177     "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
178 )
179
180
181 def func():
182     c = call(
183         0.0123,
184         0.0456,
185         0.0789,
186         0.0123,
187         0.0789,
188         a[-1],  # type: ignore
189     )
190     c = call(0.0123, 0.0456, 0.0789, 0.0123, 0.0789, a[-1])  # type: ignore
191     c = call(
192         0.0123,
193         0.0456,
194         0.0789,
195         0.0123,
196         0.0456,
197         0.0789,
198         0.0123,
199         0.0456,
200         0.0789,
201         a[-1],  # type: ignore
202     )
203
204     # The type: ignore exception only applies to line length, not
205     # other types of formatting.
206     c = call(
207         "aaaaaaaa",
208         "aaaaaaaa",
209         "aaaaaaaa",
210         "aaaaaaaa",
211         "aaaaaaaa",
212         "aaaaaaaa",  # type: ignore
213         "aaaaaaaa",
214         "aaaaaaaa",
215         "aaaaaaaa",
216         "aaaaaaaa",
217         "aaaaaaaa",
218         "aaaaaaaa",
219     )
220
221
222 class C:
223     @pytest.mark.parametrize(
224         ("post_data", "message"),
225         [
226             # metadata_version errors.
227             (
228                 {},
229                 "None is an invalid value for Metadata-Version. Error: This field is"
230                 " required. see"
231                 " https://packaging.python.org/specifications/core-metadata",
232             ),
233             (
234                 {"metadata_version": "-1"},
235                 "'-1' is an invalid value for Metadata-Version. Error: Unknown Metadata"
236                 " Version see"
237                 " https://packaging.python.org/specifications/core-metadata",
238             ),
239             # name errors.
240             (
241                 {"metadata_version": "1.2"},
242                 "'' is an invalid value for Name. Error: This field is required. see"
243                 " https://packaging.python.org/specifications/core-metadata",
244             ),
245             (
246                 {"metadata_version": "1.2", "name": "foo-"},
247                 "'foo-' is an invalid value for Name. Error: Must start and end with a"
248                 " letter or numeral and contain only ascii numeric and '.', '_' and"
249                 " '-'. see https://packaging.python.org/specifications/core-metadata",
250             ),
251             # version errors.
252             (
253                 {"metadata_version": "1.2", "name": "example"},
254                 "'' is an invalid value for Version. Error: This field is required. see"
255                 " https://packaging.python.org/specifications/core-metadata",
256             ),
257             (
258                 {"metadata_version": "1.2", "name": "example", "version": "dog"},
259                 "'dog' is an invalid value for Version. Error: Must start and end with"
260                 " a letter or numeral and contain only ascii numeric and '.', '_' and"
261                 " '-'. see https://packaging.python.org/specifications/core-metadata",
262             ),
263         ],
264     )
265     def test_fails_invalid_post_data(
266         self, pyramid_config, db_request, post_data, message
267     ):
268         ...
269
270
271 square = Square(4)  # type: Optional[Square]