diff options
author | 2018-10-31 16:47:56 -0700 | |
---|---|---|
committer | 2018-10-31 16:47:56 -0700 | |
commit | acc72c0835eb84a79e779ede7a0383bddd8feef5 (patch) | |
tree | 07c7031fbae3303c6cea7cabfb97b63fb627c685 | |
parent | 79d0424468d500a818384de8a5e056ec04bb7da3 (diff) |
Format code
-rw-r--r-- | src/python/grpcio_tests/tests/unit/_logging_test.py | 8 |
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) |