Commit 91cb295
committed
refactor(test): modernize waiter code with Python idioms and robust tests
why: Improve code readability, maintainability and reliability through modern Python patterns and enhanced test coverage for edge cases.
what:
- Replace for-loops with next() and generator expressions
- Use walrus operator (:=) to reduce nesting in conditional code
- Remove redundant conditional code in retry_extended.py
- Fix incorrect test expectations for invalid prompt handling
- Add negative test cases for line range validation
- Update docstrings for better clarity and accuracy
refs: #sourcery-ai1 parent b846f03 commit 91cb295
File tree
3 files changed
+346
-48
lines changed- src/libtmux/test
- tests/test
3 files changed
+346
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1090 | 1090 | | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | | - | |
| 1093 | + | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1109 | 1107 | | |
1110 | 1108 | | |
1111 | 1109 | | |
| |||
1129 | 1127 | | |
1130 | 1128 | | |
1131 | 1129 | | |
1132 | | - | |
1133 | 1130 | | |
1134 | | - | |
| 1131 | + | |
1135 | 1132 | | |
1136 | 1133 | | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
| |||
1159 | 1159 | | |
1160 | 1160 | | |
1161 | 1161 | | |
1162 | | - | |
1163 | 1162 | | |
1164 | | - | |
| 1163 | + | |
1165 | 1164 | | |
1166 | 1165 | | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
1172 | 1174 | | |
1173 | 1175 | | |
0 commit comments