Skip to content

Commit dec5582

Browse files
committed
Filter resource_tracker warnings in integration tests
Python 3.14+ emits multiprocessing resource_tracker warnings about leaked semaphores during test subprocess cleanup. These warnings appear in stderr and cause test assertions to fail. Filter them out the same way we already filter DeprecationWarnings. Fixes integration test failures on Python 3.14.
1 parent 7411422 commit dec5582

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/integration/helpers.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,15 @@ def print_json_indented(value):
368368

369369

370370
def remove_warnings(text):
371-
return linesep.join(line for line in text.split(linesep) if 'DeprecationWarning' not in line)
371+
"""Filter out Python warnings from command output."""
372+
return linesep.join(
373+
line
374+
for line in text.split(linesep)
375+
if 'DeprecationWarning' not in line
376+
and 'resource_tracker' not in line # Python 3.14+ multiprocessing warnings
377+
and 'UserWarning' not in line # Python 3.14+ shows more warning details
378+
and 'warnings.warn(' not in line # Python 3.14+ shows source line in warnings
379+
)
372380

373381

374382
class StringReader:

0 commit comments

Comments
 (0)