Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Commit48441a9
committed
Lint test/ (not just git/), fix warnings and a bug
This expands flake8 linting to include the test suite, and fixesthe resulting warnings. Four code changes are especially notable:- Unit tests from which documentation is automatically generated contain a few occurrences of "#@NoEffect". These suppressions are extended to "# noqa: B015 #@NoEffect" so the corresponding suppression is also applied for flake8. This is significant because it actually changes what appears in the code examples in the generated documentation. However, since the "@NoEffect" annotation was considered acceptable, this may be okay too. The resulting examples did not become excessively long.- Expressions like "[c for c in commits_for_file_generator]" appear in some unit tests from which documentation is automatically generated. The simpler form "list(commits_for_file_generator)" can replace them. This changes the examples in the documentation, but for the better, since that form is simpler (and also a better practice in general, thus a better thing to show readers). So I made those substitutions.- In test_repo.TestRepo.test_git_work_tree_env, the code intended to unpatch environment variables after the test was ineffective, instead causing os.environ to refer to an ordinary dict object that does not affect environment variables when written to. This uses unittest.mock.patch.dict instead, so the variables are unpatched and subsequent writes to environment variables in the test process are effective.- In test_submodule.TestSubmodule._do_base_tests, the expression statement "csm.module().head.ref.tracking_branch() is not None" appeared to be intended as an assertion, in spite of having been annoated@NoEffect. This is in light of the context and because, if the goal were only to exercise the function call, the "is not None" part would be superfluous. So I made it an assertion.1 parentc1ec9cb commit48441a9
File tree
9 files changed
+32
-36
lines changed- test
9 files changed
+32
-36
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
|
Lines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
277 | 277 |
| |
278 | 278 |
| |
279 | 279 |
| |
280 |
| - | |
| 280 | + | |
281 | 281 |
| |
282 | 282 |
| |
283 | 283 |
| |
| |||
525 | 525 |
| |
526 | 526 |
| |
527 | 527 |
| |
528 |
| - | |
529 |
| - | |
530 |
| - | |
531 |
| - | |
532 |
| - | |
533 |
| - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
534 | 534 |
| |
535 | 535 |
| |
536 | 536 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
11 | 10 |
| |
12 | 11 |
| |
13 | 12 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
263 | 263 |
| |
264 | 264 |
| |
265 | 265 |
| |
266 |
| - | |
267 |
| - | |
268 |
| - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
269 | 269 |
| |
270 | 270 |
| |
271 | 271 |
| |
| |||
369 | 369 |
| |
370 | 370 |
| |
371 | 371 |
| |
372 |
| - | |
| 372 | + | |
373 | 373 |
| |
374 | 374 |
| |
375 | 375 |
| |
|
Lines changed: 6 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
2 |
| - | |
3 |
| - | |
4 | 1 |
| |
5 | 2 |
| |
6 | 3 |
| |
| |||
25 | 22 |
| |
26 | 23 |
| |
27 | 24 |
| |
| 25 | + | |
| 26 | + | |
28 | 27 |
| |
29 | 28 |
| |
30 | 29 |
| |
31 |
| - | |
32 | 30 |
| |
33 | 31 |
| |
34 | 32 |
| |
| |||
72 | 70 |
| |
73 | 71 |
| |
74 | 72 |
| |
75 |
| - | |
| 73 | + | |
76 | 74 |
| |
77 | 75 |
| |
78 | 76 |
| |
| |||
136 | 134 |
| |
137 | 135 |
| |
138 | 136 |
| |
139 |
| - | |
| 137 | + | |
140 | 138 |
| |
141 | 139 |
| |
142 | 140 |
| |
| |||
154 | 152 |
| |
155 | 153 |
| |
156 | 154 |
| |
157 |
| - | |
| 155 | + | |
158 | 156 |
| |
159 | 157 |
| |
160 | 158 |
| |
| |||
210 | 208 |
| |
211 | 209 |
| |
212 | 210 |
| |
213 |
| - | |
| 211 | + | |
214 | 212 |
| |
215 | 213 |
| |
216 | 214 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
160 | 160 |
| |
161 | 161 |
| |
162 | 162 |
| |
163 |
| - | |
| 163 | + | |
164 | 164 |
| |
165 | 165 |
| |
166 | 166 |
| |
|
Lines changed: 7 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
252 | 252 |
| |
253 | 253 |
| |
254 | 254 |
| |
255 |
| - | |
| 255 | + | |
| 256 | + | |
256 | 257 |
| |
257 | 258 |
| |
258 | 259 |
| |
| |||
758 | 759 |
| |
759 | 760 |
| |
760 | 761 |
| |
761 |
| - | |
762 | 762 |
| |
763 | 763 |
| |
| 764 | + | |
764 | 765 |
| |
765 | 766 |
| |
766 | 767 |
| |
| |||
971 | 972 |
| |
972 | 973 |
| |
973 | 974 |
| |
974 |
| - | |
| 975 | + | |
975 | 976 |
| |
976 | 977 |
| |
977 | 978 |
| |
| |||
1329 | 1330 |
| |
1330 | 1331 |
| |
1331 | 1332 |
| |
| 1333 | + | |
1332 | 1334 |
| |
1333 | 1335 |
| |
1334 | 1336 |
| |
| |||
1338 | 1340 |
| |
1339 | 1341 |
| |
1340 | 1342 |
| |
1341 |
| - | |
1342 |
| - | |
1343 |
| - | |
| 1343 | + | |
1344 | 1344 |
| |
1345 |
| - | |
| 1345 | + | |
1346 | 1346 |
| |
1347 | 1347 |
| |
1348 | 1348 |
| |
1349 |
| - | |
1350 |
| - | |
1351 | 1349 |
| |
1352 | 1350 |
| |
1353 | 1351 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
114 |
| - | |
| 114 | + | |
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
| |||
248 | 248 |
| |
249 | 249 |
| |
250 | 250 |
| |
251 |
| - | |
| 251 | + | |
252 | 252 |
| |
253 | 253 |
| |
254 | 254 |
| |
| |||
480 | 480 |
| |
481 | 481 |
| |
482 | 482 |
| |
483 |
| - | |
484 |
| - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
485 | 486 |
| |
486 | 487 |
| |
487 | 488 |
| |
|
0 commit comments
Comments
(0)