@@ -390,14 +390,15 @@ def determine_wants(refs, depth=None):
390390 # Get all refs
391391 return list (refs .values ())
392392
393- # Fetch with filter
394- result = client .fetch (
395- path ,
396- dest_repo ,
397- determine_wants = determine_wants ,
398- progress = None ,
399- filter_spec = b"blob:none" ,
400- )
393+ # Fetch with filter (may warn if server doesn't support filtering)
394+ with self .assertLogs (level = "WARNING" ):
395+ result = client .fetch (
396+ path ,
397+ dest_repo ,
398+ determine_wants = determine_wants ,
399+ progress = None ,
400+ filter_spec = b"blob:none" ,
401+ )
401402
402403 # The fetch should succeed with partial clone
403404 self .assertIsNotNone (result )
@@ -430,13 +431,14 @@ def test_clone_with_filter(self) -> None:
430431
431432 client , path = get_transport_and_path (f"git://localhost:{ daemon_port } /" )
432433
433- # Clone with blob:limit filter
434- cloned_repo = client .clone (
435- path ,
436- dest_path ,
437- mkdir = False ,
438- filter_spec = b"blob:limit=100" ,
439- )
434+ # Clone with blob:limit filter (may warn if server doesn't support filtering)
435+ with self .assertLogs (level = "WARNING" ):
436+ cloned_repo = client .clone (
437+ path ,
438+ dest_path ,
439+ mkdir = False ,
440+ filter_spec = b"blob:limit=100" ,
441+ )
440442 self .addCleanup (cloned_repo .close )
441443
442444 # Verify clone succeeded
@@ -483,6 +485,11 @@ def _start_git_daemon(self, repo_path):
483485 def cleanup_daemon ():
484486 daemon_process .terminate ()
485487 daemon_process .wait (timeout = 2 )
488+ # Close pipes to avoid ResourceWarning
489+ if daemon_process .stdout :
490+ daemon_process .stdout .close ()
491+ if daemon_process .stderr :
492+ daemon_process .stderr .close ()
486493
487494 self .addCleanup (cleanup_daemon )
488495
0 commit comments