From 619f7e767b64ac4db051d18d2af15040c26aeace Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 30 Oct 2018 18:43:18 -0700 Subject: [PATCH] Add basicConfig handler to unit tests --- src/python/grpcio_tests/tests/unit/_api_test.py | 1 + src/python/grpcio_tests/tests/unit/_auth_context_test.py | 1 + src/python/grpcio_tests/tests/unit/_auth_test.py | 1 + src/python/grpcio_tests/tests/unit/_channel_args_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_channel_close_test.py | 2 ++ .../grpcio_tests/tests/unit/_channel_connectivity_test.py | 2 ++ .../grpcio_tests/tests/unit/_channel_ready_future_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_compression_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_credentials_test.py | 3 +++ src/python/grpcio_tests/tests/unit/_empty_message_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_exit_scenarios.py | 2 ++ src/python/grpcio_tests/tests/unit/_exit_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_interceptor_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_invocation_defects_test.py | 2 ++ .../grpcio_tests/tests/unit/_metadata_code_details_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_metadata_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_reconnect_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_rpc_test.py | 2 ++ .../grpcio_tests/tests/unit/_server_ssl_cert_config_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_server_test.py | 2 ++ src/python/grpcio_tests/tests/unit/_session_cache_test.py | 2 ++ 23 files changed, 44 insertions(+) diff --git a/src/python/grpcio_tests/tests/unit/_api_test.py b/src/python/grpcio_tests/tests/unit/_api_test.py index f6245be77d2..5dfb8b2b54d 100644 --- a/src/python/grpcio_tests/tests/unit/_api_test.py +++ b/src/python/grpcio_tests/tests/unit/_api_test.py @@ -102,4 +102,5 @@ class ChannelTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_auth_context_test.py b/src/python/grpcio_tests/tests/unit/_auth_context_test.py index d1740510701..67f222d4b13 100644 --- a/src/python/grpcio_tests/tests/unit/_auth_context_test.py +++ b/src/python/grpcio_tests/tests/unit/_auth_context_test.py @@ -187,4 +187,5 @@ class AuthContextTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_auth_test.py b/src/python/grpcio_tests/tests/unit/_auth_test.py index e2cb9389368..e125e775416 100644 --- a/src/python/grpcio_tests/tests/unit/_auth_test.py +++ b/src/python/grpcio_tests/tests/unit/_auth_test.py @@ -77,4 +77,5 @@ class AccessTokenAuthMetadataPluginTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_channel_args_test.py b/src/python/grpcio_tests/tests/unit/_channel_args_test.py index 869c2f4d2f4..0f5e49cbd59 100644 --- a/src/python/grpcio_tests/tests/unit/_channel_args_test.py +++ b/src/python/grpcio_tests/tests/unit/_channel_args_test.py @@ -15,6 +15,7 @@ from concurrent import futures import unittest +import logging import grpc @@ -46,4 +47,5 @@ class ChannelArgsTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_channel_close_test.py b/src/python/grpcio_tests/tests/unit/_channel_close_test.py index af3a9ee1ee1..82fa1657109 100644 --- a/src/python/grpcio_tests/tests/unit/_channel_close_test.py +++ b/src/python/grpcio_tests/tests/unit/_channel_close_test.py @@ -13,6 +13,7 @@ # limitations under the License. """Tests server and client side compression.""" +import logging import threading import time import unittest @@ -182,4 +183,5 @@ class ChannelCloseTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py b/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py index f9eb0011dc5..727fb7d65fe 100644 --- a/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py +++ b/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py @@ -13,6 +13,7 @@ # limitations under the License. """Tests of grpc._channel.Channel connectivity.""" +import logging import threading import time import unittest @@ -142,4 +143,5 @@ class ChannelConnectivityTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py b/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py index 30b486079c8..345460ef40d 100644 --- a/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py +++ b/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py @@ -15,6 +15,7 @@ import threading import unittest +import logging import grpc from tests.unit.framework.common import test_constants @@ -85,4 +86,5 @@ class ChannelReadyFutureTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_compression_test.py b/src/python/grpcio_tests/tests/unit/_compression_test.py index 0b11f03adf5..876d8e827ea 100644 --- a/src/python/grpcio_tests/tests/unit/_compression_test.py +++ b/src/python/grpcio_tests/tests/unit/_compression_test.py @@ -15,6 +15,7 @@ import unittest +import logging import grpc from grpc import _grpcio_metadata @@ -117,4 +118,5 @@ class CompressionTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_credentials_test.py b/src/python/grpcio_tests/tests/unit/_credentials_test.py index f487fe66a2d..4ba40e2e8a1 100644 --- a/src/python/grpcio_tests/tests/unit/_credentials_test.py +++ b/src/python/grpcio_tests/tests/unit/_credentials_test.py @@ -13,7 +13,9 @@ # limitations under the License. """Tests of credentials.""" + import unittest +import logging import grpc @@ -54,4 +56,5 @@ class CredentialsTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_empty_message_test.py b/src/python/grpcio_tests/tests/unit/_empty_message_test.py index c55ef61c132..3e8393b53c3 100644 --- a/src/python/grpcio_tests/tests/unit/_empty_message_test.py +++ b/src/python/grpcio_tests/tests/unit/_empty_message_test.py @@ -13,6 +13,7 @@ # limitations under the License. import unittest +import logging import grpc @@ -118,4 +119,5 @@ class EmptyMessageTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_exit_scenarios.py b/src/python/grpcio_tests/tests/unit/_exit_scenarios.py index 0a0239a63d8..f489db12cb3 100644 --- a/src/python/grpcio_tests/tests/unit/_exit_scenarios.py +++ b/src/python/grpcio_tests/tests/unit/_exit_scenarios.py @@ -16,6 +16,7 @@ import argparse import threading import time +import logging import grpc @@ -161,6 +162,7 @@ def infinite_request_iterator(): if __name__ == '__main__': + logging.basicConfig() parser = argparse.ArgumentParser() parser.add_argument('scenario', type=str) parser.add_argument( diff --git a/src/python/grpcio_tests/tests/unit/_exit_test.py b/src/python/grpcio_tests/tests/unit/_exit_test.py index f40f3ae07cd..52265375799 100644 --- a/src/python/grpcio_tests/tests/unit/_exit_test.py +++ b/src/python/grpcio_tests/tests/unit/_exit_test.py @@ -26,6 +26,7 @@ import sys import threading import time import unittest +import logging from tests.unit import _exit_scenarios @@ -187,4 +188,5 @@ class ExitTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_interceptor_test.py b/src/python/grpcio_tests/tests/unit/_interceptor_test.py index 3d547b71cd5..99db0ac58b1 100644 --- a/src/python/grpcio_tests/tests/unit/_interceptor_test.py +++ b/src/python/grpcio_tests/tests/unit/_interceptor_test.py @@ -17,6 +17,7 @@ import collections import itertools import threading import unittest +import logging from concurrent import futures import grpc @@ -598,4 +599,5 @@ class InterceptorTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py b/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py index f153089a24d..9771764635c 100644 --- a/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py +++ b/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py @@ -14,6 +14,7 @@ """Test of RPCs made against gRPC Python's application-layer API.""" import unittest +import logging import grpc @@ -131,4 +132,5 @@ class InvalidMetadataTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py b/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py index 93a5fdf9ff2..00949e22366 100644 --- a/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py +++ b/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py @@ -15,6 +15,7 @@ import itertools import threading import unittest +import logging import grpc @@ -271,4 +272,5 @@ class InvocationDefectsTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py b/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py index ca10bd4dab5..0dafab827a8 100644 --- a/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py +++ b/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py @@ -15,6 +15,7 @@ import threading import unittest +import logging import grpc @@ -656,4 +657,5 @@ class MetadataCodeDetailsTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_metadata_test.py b/src/python/grpcio_tests/tests/unit/_metadata_test.py index 59084210113..777ab683e36 100644 --- a/src/python/grpcio_tests/tests/unit/_metadata_test.py +++ b/src/python/grpcio_tests/tests/unit/_metadata_test.py @@ -15,6 +15,7 @@ import unittest import weakref +import logging import grpc from grpc import _channel @@ -237,4 +238,5 @@ class MetadataTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_reconnect_test.py b/src/python/grpcio_tests/tests/unit/_reconnect_test.py index a708d8d862b..f6d4fcbd0a5 100644 --- a/src/python/grpcio_tests/tests/unit/_reconnect_test.py +++ b/src/python/grpcio_tests/tests/unit/_reconnect_test.py @@ -15,6 +15,7 @@ import socket import time +import logging import unittest import grpc @@ -100,4 +101,5 @@ class ReconnectTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py b/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py index df4b129018b..4fead8fcd54 100644 --- a/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py +++ b/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py @@ -15,6 +15,7 @@ import threading import unittest +import logging import grpc from grpc import _channel @@ -253,4 +254,5 @@ class ResourceExhaustedTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_rpc_test.py b/src/python/grpcio_tests/tests/unit/_rpc_test.py index 34e7831a983..a768d6c7c1c 100644 --- a/src/python/grpcio_tests/tests/unit/_rpc_test.py +++ b/src/python/grpcio_tests/tests/unit/_rpc_test.py @@ -16,6 +16,7 @@ import itertools import threading import unittest +import logging from concurrent import futures import grpc @@ -846,4 +847,5 @@ class RPCTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py b/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py index 0d78034b7be..e733a59a5b1 100644 --- a/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py +++ b/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py @@ -35,6 +35,7 @@ import os import six import threading import unittest +import logging from concurrent import futures @@ -518,4 +519,5 @@ class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_server_test.py b/src/python/grpcio_tests/tests/unit/_server_test.py index acf4a179219..47c32413ddb 100644 --- a/src/python/grpcio_tests/tests/unit/_server_test.py +++ b/src/python/grpcio_tests/tests/unit/_server_test.py @@ -14,6 +14,7 @@ from concurrent import futures import unittest +import logging import grpc @@ -49,4 +50,5 @@ class ServerTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_session_cache_test.py b/src/python/grpcio_tests/tests/unit/_session_cache_test.py index b4e4670fa73..9223a6da03a 100644 --- a/src/python/grpcio_tests/tests/unit/_session_cache_test.py +++ b/src/python/grpcio_tests/tests/unit/_session_cache_test.py @@ -15,6 +15,7 @@ import pickle import unittest +import logging import grpc from grpc import _channel @@ -142,4 +143,5 @@ class SSLSessionCacheTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2)