Commit e14cebd
Fix silently-passing subprocess tests and process resource leak (#112)
* Fix PicklingError in subprocess spawn by moving fixtures to conftest.py
Co-authored-by: lostmsu <239520+lostmsu@users.noreply.github.com>
* Fix silent subprocess failures: assert exitcode and fix test_coreclr_properties kwargs
The real reason CI doesn't fail despite Python 3.13 being tested:
run_in_subprocess never checked p.exitcode, so any subprocess crash was
silently ignored by the parent test.
Adding the assert immediately exposes a pre-existing bug:
test_coreclr_properties passed properties=dict(...) as a single kwarg,
but _do_test_coreclr_autogenerated_runtimeconfig uses **properties to
collect individual kwargs. This double-wrapped the dict, causing
AttributeError: 'dict' object has no attribute 'encode' in the subprocess
— silently swallowed until now.
Co-authored-by: lostmsu <239520+lostmsu@users.noreply.github.com>
* Fix resource leak: wrap p.exitcode assert in try/finally so p.close() always runs
Without try/finally, if `assert p.exitcode == 0` raises AssertionError,
`p.close()` is never called. This leaves the Process object unclosed
and causes `ResourceWarning: process ... not closed` on Python 3.12+.
Co-authored-by: lostmsu <239520+lostmsu@users.noreply.github.com>
* Fix format
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lostmsu <239520+lostmsu@users.noreply.github.com>
Co-authored-by: Benedikt Reinartz <filmor@gmail.com>1 parent d3fa8a8 commit e14cebd
2 files changed
+32
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | 7 | | |
30 | 8 | | |
31 | 9 | | |
| |||
112 | 90 | | |
113 | 91 | | |
114 | 92 | | |
115 | | - | |
| 93 | + | |
116 | 94 | | |
117 | 95 | | |
118 | 96 | | |
| |||
177 | 155 | | |
178 | 156 | | |
179 | 157 | | |
180 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
0 commit comments