From 42c86722fc39c90af8327f9ac41d0e45b0f2fc84 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Tue, 16 Oct 2018 11:00:39 -0700 Subject: [PATCH] test_adb.py: silence ResourceWarning. Test: ./adb_test.py Change-Id: If12558492e4edafd3568530a96eac2032526877d --- adb/test_adb.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adb/test_adb.py b/adb/test_adb.py index 7e73818df..430fc3d85 100755 --- a/adb/test_adb.py +++ b/adb/test_adb.py @@ -31,6 +31,7 @@ import sys import threading import time import unittest +import warnings @contextlib.contextmanager @@ -229,6 +230,10 @@ class ServerTest(unittest.TestCase): stderr=subprocess.STDOUT) try: + # We get warnings for unclosed files for the subprocess's pipes, + # and it's somewhat cumbersome to close them, so just ignore this. + warnings.simplefilter("ignore", ResourceWarning) + # Run the adb client and have it start the adb server. proc = subprocess.Popen(["adb", "-P", str(port), "start-server"], stdin=subprocess.PIPE,