Commit 4d391b2
committed
fix(core): close Reaper socket at interpreter exit to prevent ResourceWarning
The Ryuk keep-alive socket stored in `Reaper._socket` was never explicitly
closed, so CPython's GC finalized it during interpreter shutdown and emitted
a ResourceWarning ("unclosed <socket.socket ...>") that is impossible to
suppress via warnings filters because it fires after pytest exits.
Registering `Reaper.delete_instance` with `atexit` ensures the socket is closed
cleanly before the GC sweep, eliminating the warning without changing the
socket's lifetime during the test session.
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>1 parent 6deaf3b commit 4d391b2
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
| 480 | + | |
479 | 481 | | |
480 | 482 | | |
0 commit comments