]> 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:

Update Contributing Docs (#1915)
[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 # output
133
134 from .config import (
135     Any,
136     Bool,
137     ConfigType,
138     ConfigTypeAttributes,
139     Int,
140     Path,
141     #  String,
142     #  resolve_to_config_type,
143     #  DEFAULT_TYPE_ATTRIBUTES,
144 )
145
146
147 from .config import (
148     Any,
149     Bool,
150     ConfigType,
151     ConfigTypeAttributes,
152     Int,
153     no_comma_here_yet,
154     #  and some comments,
155     #  resolve_to_config_type,
156     #  DEFAULT_TYPE_ATTRIBUTES,
157 )
158 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
159     MyLovelyCompanyTeamProjectComponent,  # NOT DRY
160 )
161 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
162     MyLovelyCompanyTeamProjectComponent as component,  # DRY
163 )
164
165
166 result = 1  # look ma, no comment migration xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
167
168 result = 1  # look ma, no comment migration xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
169
170 result = (  # aaa
171     "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
172 )
173
174 result = (  # aaa
175     "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
176 )
177
178
179 def func():
180     c = call(
181         0.0123,
182         0.0456,
183         0.0789,
184         0.0123,
185         0.0789,
186         a[-1],  # type: ignore
187     )
188     c = call(0.0123, 0.0456, 0.0789, 0.0123, 0.0789, a[-1])  # type: ignore
189     c = call(
190         0.0123,
191         0.0456,
192         0.0789,
193         0.0123,
194         0.0456,
195         0.0789,
196         0.0123,
197         0.0456,
198         0.0789,
199         a[-1],  # type: ignore
200     )
201
202     # The type: ignore exception only applies to line length, not
203     # other types of formatting.
204     c = call(
205         "aaaaaaaa",
206         "aaaaaaaa",
207         "aaaaaaaa",
208         "aaaaaaaa",
209         "aaaaaaaa",
210         "aaaaaaaa",  # type: ignore
211         "aaaaaaaa",
212         "aaaaaaaa",
213         "aaaaaaaa",
214         "aaaaaaaa",
215         "aaaaaaaa",
216         "aaaaaaaa",
217     )
218
219
220 class C:
221     @pytest.mark.parametrize(
222         ("post_data", "message"),
223         [
224             # metadata_version errors.
225             (
226                 {},
227                 "None is an invalid value for Metadata-Version. Error: This field is"
228                 " required. see"
229                 " https://packaging.python.org/specifications/core-metadata",
230             ),
231             (
232                 {"metadata_version": "-1"},
233                 "'-1' is an invalid value for Metadata-Version. Error: Unknown Metadata"
234                 " Version see"
235                 " https://packaging.python.org/specifications/core-metadata",
236             ),
237             # name errors.
238             (
239                 {"metadata_version": "1.2"},
240                 "'' is an invalid value for Name. Error: This field is required. see"
241                 " https://packaging.python.org/specifications/core-metadata",
242             ),
243             (
244                 {"metadata_version": "1.2", "name": "foo-"},
245                 "'foo-' is an invalid value for Name. Error: Must start and end with a"
246                 " letter or numeral and contain only ascii numeric and '.', '_' and"
247                 " '-'. see https://packaging.python.org/specifications/core-metadata",
248             ),
249             # version errors.
250             (
251                 {"metadata_version": "1.2", "name": "example"},
252                 "'' is an invalid value for Version. Error: This field is required. see"
253                 " https://packaging.python.org/specifications/core-metadata",
254             ),
255             (
256                 {"metadata_version": "1.2", "name": "example", "version": "dog"},
257                 "'dog' is an invalid value for Version. Error: Must start and end with"
258                 " a letter or numeral and contain only ascii numeric and '.', '_' and"
259                 " '-'. see https://packaging.python.org/specifications/core-metadata",
260             ),
261         ],
262     )
263     def test_fails_invalid_post_data(
264         self, pyramid_config, db_request, post_data, message
265     ):
266         ...