This repository was archived by the owner on Aug 13, 2025. It is now read-only.
Commit 0c2bdbc
committed
Keep the tempdir in case test setup/teardown fails
When an issue occurs inside a fixture (e.g. servers fail to start/stop),
the test result won't be detected as failed, but rather an error will be
thrown.
To ensure the tempdir is kept even if the test itself passes but the
system_test() fixture throws an error, a different mechanism is needed.
At the start of the critical test setup section, note that the fixture
hasn't finished yet. When this is detected in the system_test_dir()
fixture, it is recognized as error in test setup/teardown and the temp
directory is kept.
This may seem cumbersome, because it is. It's basically a workaround for
the way pytest handles fixtures and test errors in general.1 parent b5c7ccf commit 0c2bdbc
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
| |||
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
| 461 | + | |
| 462 | + | |
456 | 463 | | |
457 | 464 | | |
458 | 465 | | |
459 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
460 | 472 | | |
461 | 473 | | |
462 | 474 | | |
| |||
466 | 478 | | |
467 | 479 | | |
468 | 480 | | |
| 481 | + | |
0 commit comments