Repository navigation
Commit 3dea5bc
committed
test: write test output to tmp_path, untrack generated FITS artifacts
test_autoarray wrote test *output* into tracked paths, so any change to the
autonerves FITS writer rewrote a committed binary and dirtied the tree for every
contributor. #483 demonstrated it: the PyAutoNerves#155 header-comment fix
([""] -> "") silently modified structures/arrays/files/array/output_test/array.fits
the moment the autonerves floor moved -- identical cards, values, data and byte
size, but a modified tracked file that had to be committed into an unrelated PR.
Applies the durable fix uniformly rather than patching file-by-file again: the
nine tests that wrote into an output_test/ directory now take pytest's tmp_path
and drop their rmtree/makedirs preamble. After a full run no output_test/
directory is created anywhere in the source tree.
Untracks the 13 exposed artifacts. Only one of them was a live output -- the
array.fits that #483 flipped. The other twelve were orphans: no test referenced
their paths, and a repo-wide grep for their basenames returned nothing. They
were residue from tests deleted long ago, as were the two file-by-file
.gitignore lines, now replaced by a test_autoarray/**/output_test/ pattern that
serves as a backstop against a future writer regressing this.
Two incidental fixes fall out. test_uniform_1d and test_uniform_2d both rmtree'd
the same shared output directory, an ordering hazard tmp_path removes. And the
three imaging tests that took the test_data_path fixture wrote their generated
FITS into the source tree via that fixture; they now use tmp_path and the
fixture is gone.
Verified from a clean checkout: 1177 passed, 55 skipped, run twice in a row with
git status clean after each -- the second run is what would catch a test that
had silently depended on a committed artifact.
Closes #494
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QoAeGsJyiaLG4oqXb9n3dM1 parent 2c06e4a commit 3dea5bc
20 files changed
Lines changed: 48 additions & 106 deletions
File tree
- test_autoarray
- dataset
- files
- arrays/output_test
- array/output_test
- imaging
- interferometer
- mask
- structures
- arrays
- files
- array/output_test
- output_test
- values/output_test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 14 | | |
29 | 15 | | |
30 | 16 | | |
| |||
162 | 148 | | |
163 | 149 | | |
164 | 150 | | |
165 | | - | |
166 | | - | |
167 | | - | |
| 151 | + | |
168 | 152 | | |
169 | 153 | | |
170 | 154 | | |
171 | 155 | | |
172 | 156 | | |
173 | 157 | | |
174 | 158 | | |
175 | | - | |
| 159 | + | |
176 | 160 | | |
177 | 161 | | |
178 | 162 | | |
179 | 163 | | |
180 | | - | |
| 164 | + | |
181 | 165 | | |
182 | 166 | | |
183 | 167 | | |
184 | 168 | | |
185 | | - | |
| 169 | + | |
186 | 170 | | |
187 | 171 | | |
188 | 172 | | |
| |||
191 | 175 | | |
192 | 176 | | |
193 | 177 | | |
194 | | - | |
195 | | - | |
196 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
197 | 181 | | |
198 | 182 | | |
199 | 183 | | |
| |||
202 | 186 | | |
203 | 187 | | |
204 | 188 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 189 | + | |
208 | 190 | | |
209 | 191 | | |
210 | 192 | | |
211 | 193 | | |
212 | 194 | | |
213 | | - | |
| 195 | + | |
214 | 196 | | |
215 | 197 | | |
216 | 198 | | |
217 | 199 | | |
218 | | - | |
| 200 | + | |
219 | 201 | | |
220 | 202 | | |
221 | 203 | | |
| |||
224 | 206 | | |
225 | 207 | | |
226 | 208 | | |
227 | | - | |
228 | | - | |
| 209 | + | |
| 210 | + | |
229 | 211 | | |
230 | 212 | | |
231 | 213 | | |
232 | 214 | | |
233 | 215 | | |
234 | 216 | | |
235 | 217 | | |
236 | | - | |
237 | | - | |
238 | | - | |
| 218 | + | |
239 | 219 | | |
240 | 220 | | |
241 | 221 | | |
242 | 222 | | |
243 | 223 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
247 | 227 | | |
248 | 228 | | |
249 | 229 | | |
250 | 230 | | |
251 | 231 | | |
252 | | - | |
253 | | - | |
254 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
255 | 235 | | |
256 | 236 | | |
257 | 237 | | |
| |||
0 commit comments