Repository navigation
Commit 1ec2e25
test: assert orphan cleanup against the path production created
The orphan checks asserted that a directory held no matching files, which only
proves cleanup if the file landed in that directory to begin with. That held solely
because the helpers route through the global tempfile.tempdir the tests patch --
an assumption the tests never checked. A change that passed an explicit dir would
have made them pass while a partial file leaked into the real temp dir.
A shared `_record_created_paths` spy now wraps the temp-file factory, delegating to
the real one and recording each path it hands out. The tests assert on that path:
one file was created, it was where the test expected, and it is gone.
Verified by breaking it two ways. With the unlink removed the tests fail, as
before. With the unlink removed AND the destination pinned to an explicit dir that
ignores the patched tempdir -- the vacuous case, which the old directory-glob
assertion passed -- they now fail too.
Applied to the spill test as well. Review only raised the two copy-failure tests,
but that one asserted on an empty directory for the same reason and could go
vacuous the same way if `dir_` stopped being honored.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 3080cf6 commit 1ec2e25
1 file changed
Lines changed: 38 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
181 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
182 | 203 | | |
183 | 204 | | |
184 | 205 | | |
| |||
207 | 228 | | |
208 | 229 | | |
209 | 230 | | |
| 231 | + | |
210 | 232 | | |
211 | 233 | | |
212 | 234 | | |
213 | 235 | | |
214 | 236 | | |
215 | 237 | | |
216 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
217 | 243 | | |
218 | 244 | | |
219 | 245 | | |
| |||
223 | 249 | | |
224 | 250 | | |
225 | 251 | | |
| 252 | + | |
226 | 253 | | |
227 | 254 | | |
228 | 255 | | |
| |||
234 | 261 | | |
235 | 262 | | |
236 | 263 | | |
237 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
238 | 269 | | |
239 | 270 | | |
240 | 271 | | |
241 | 272 | | |
242 | 273 | | |
243 | 274 | | |
| 275 | + | |
244 | 276 | | |
245 | 277 | | |
246 | 278 | | |
| |||
252 | 284 | | |
253 | 285 | | |
254 | 286 | | |
255 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
256 | 290 | | |
257 | 291 | | |
258 | 292 | | |
| |||
0 commit comments