Commit 1456056
Fix pyre related issues in mapillary test code
Summary:
Quality insights reports 1127 missing annotations and 208 pyre-unsafe in the code base with file paths containing "mapillary" and "test".
What was fixed:
1. 208 # pyre-unsafe → # pyre-strict directives changed (plus 3 files that had no directive at all)
2. 1127 missing type annotations added:
- -> None return types on test methods
- -> <correct_type> return types on helper functions that return values
- MagicMock parameter types for patch-decorated method mock params
- Correct primitive types (str, int, float, bool, etc.) for helper function params with default values
3. 23 missing MagicMock imports added
4. All files formatted with arc lint -a
Remaining pre-existing pyre errors (not introduced by this change):
These were hidden by # pyre-unsafe and are now visible:
- synthetic_cluster_dataset.py: Callable generic type needs 2 params (3 errors)
- test_anonymization_task.py: Cannot reassign final attribute + incompatible param type (2 errors)
- merge_tests.py: np.ndarray generic type needs 2 params (4 errors)
- test_fix_vrs_frame_ids.py: patch with lambda not inferrable (5 errors — pre-existing pyre limitation)
Reviewed By: d99m
Differential Revision: D96924234
fbshipit-source-id: 338b2c7dc36cdc06cc71cb9ebe5ee2f2d6d0ece31 parent 6322e7c commit 1456056
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
0 commit comments