Commit befdae7
Increase test coverage from 98% to near 100% (facebookresearch#281)
Summary:
Adds comprehensive tests covering previously untested edge cases identified in the coverage report. The 7 files with coverage gaps now have tests for:
- **CLI**: Exception handling paths for weighting failures
- **Sample class**: Design effect diagnostics and IPW model parameters
- **CBPS**: Optimization convergence warnings and constraint violation exceptions
- **Plotting**: Functions with missing values, default parameters, and various dist_types
- **Distance metrics**: Empty numeric columns edge case
This improves the overall test coverage reliability and catches potential regressions in error handling paths.
Differential Revision: D909461461 parent 6417fb0 commit befdae7
File tree
12 files changed
+1967
-181
lines changed- .github/workflows
- balance
- stats_and_plots
- utils
- tests
12 files changed
+1967
-181
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | 656 | | |
661 | 657 | | |
662 | 658 | | |
| |||
671 | 667 | | |
672 | 668 | | |
673 | 669 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | 670 | | |
679 | 671 | | |
680 | 672 | | |
| |||
1348 | 1340 | | |
1349 | 1341 | | |
1350 | 1342 | | |
1351 | | - | |
1352 | | - | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
1356 | | - | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1357 | 1350 | | |
1358 | 1351 | | |
1359 | 1352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
826 | 827 | | |
827 | 828 | | |
828 | 829 | | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
835 | 836 | | |
836 | 837 | | |
837 | | - | |
838 | | - | |
| 838 | + | |
| 839 | + | |
839 | 840 | | |
840 | 841 | | |
841 | 842 | | |
| |||
962 | 963 | | |
963 | 964 | | |
964 | 965 | | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
| 966 | + | |
| 967 | + | |
974 | 968 | | |
975 | | - | |
976 | | - | |
| 969 | + | |
| 970 | + | |
977 | 971 | | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
978 | 975 | | |
979 | | - | |
| 976 | + | |
980 | 977 | | |
981 | 978 | | |
982 | 979 | | |
| |||
1101 | 1098 | | |
1102 | 1099 | | |
1103 | 1100 | | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
| 1101 | + | |
| 1102 | + | |
1113 | 1103 | | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
| 1104 | + | |
| 1105 | + | |
1119 | 1106 | | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1120 | 1111 | | |
1121 | 1112 | | |
1122 | 1113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 282 | + | |
| 283 | + | |
288 | 284 | | |
289 | 285 | | |
290 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
117 | 167 | | |
118 | 168 | | |
119 | 169 | | |
| |||
0 commit comments