aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Richard Belleville <rbellevi@google.com>2018-10-31 16:47:56 -0700
committerGravatar Richard Belleville <rbellevi@google.com>2018-10-31 16:47:56 -0700
commitacc72c0835eb84a79e779ede7a0383bddd8feef5 (patch)
tree07c7031fbae3303c6cea7cabfb97b63fb627c685
parent79d0424468d500a818384de8a5e056ec04bb7da3 (diff)
Format code
-rw-r--r--src/python/grpcio_tests/tests/unit/_logging_test.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/python/grpcio_tests/tests/unit/_logging_test.py b/src/python/grpcio_tests/tests/unit/_logging_test.py
index 39c3afbfc8..0b14f5e325 100644
--- a/src/python/grpcio_tests/tests/unit/_logging_test.py
+++ b/src/python/grpcio_tests/tests/unit/_logging_test.py
@@ -21,7 +21,9 @@ import grpc
import functools
import sys
+
def patch_stderr(f):
+
@functools.wraps(f)
def _impl(*args, **kwargs):
old_stderr = sys.stderr
@@ -30,8 +32,10 @@ def patch_stderr(f):
f(args, kwargs)
finally:
sys.stderr = old_stderr
+
return _impl
+
class LoggingTest(unittest.TestCase):
def test_logger_not_occupied(self):
@@ -43,9 +47,11 @@ class LoggingTest(unittest.TestCase):
reload_module(logging)
logging.basicConfig()
reload_module(grpc)
- self.assertFalse("No handlers could be found" in sys.stderr.getvalue())
+ self.assertFalse(
+ "No handlers could be found" in sys.stderr.getvalue())
finally:
reload_module(logging)
+
if __name__ == '__main__':
unittest.main(verbosity=2)