diff options
author | 2018-01-02 14:40:00 -0800 | |
---|---|---|
committer | 2018-01-02 14:40:00 -0800 | |
commit | 87cd994b0477e98c976e7b321b3c1f52666ab5e0 (patch) | |
tree | 8590a82e599e0c763f32f835ef2bbb129871e75b /src/python/grpcio_tests/tests/testing | |
parent | 63392f682e21543099926251b642cdcd0be2a17f (diff) |
Upgrade yapf to 0.20.0
Upgrade yapf version to 0.20.0 and reformat Python files.
Diffstat (limited to 'src/python/grpcio_tests/tests/testing')
5 files changed, 22 insertions, 13 deletions
diff --git a/src/python/grpcio_tests/tests/testing/_client_application.py b/src/python/grpcio_tests/tests/testing/_client_application.py index aff32fb4dc..7d0d74c8c4 100644 --- a/src/python/grpcio_tests/tests/testing/_client_application.py +++ b/src/python/grpcio_tests/tests/testing/_client_application.py @@ -235,8 +235,8 @@ def run(scenario, channel): elif scenario is Scenario.INFINITE_REQUEST_STREAM: return _run_infinite_request_stream(stub) except grpc.RpcError as rpc_error: - return Outcome(Outcome.Kind.RPC_ERROR, - rpc_error.code(), rpc_error.details()) + return Outcome(Outcome.Kind.RPC_ERROR, rpc_error.code(), + rpc_error.details()) _IMPLEMENTATIONS = { @@ -256,5 +256,5 @@ def run(scenario, channel): try: return _IMPLEMENTATIONS[scenario](stub) except grpc.RpcError as rpc_error: - return Outcome(Outcome.Kind.RPC_ERROR, - rpc_error.code(), rpc_error.details()) + return Outcome(Outcome.Kind.RPC_ERROR, rpc_error.code(), + rpc_error.details()) diff --git a/src/python/grpcio_tests/tests/testing/_client_test.py b/src/python/grpcio_tests/tests/testing/_client_test.py index 172f386d7b..5b051c3939 100644 --- a/src/python/grpcio_tests/tests/testing/_client_test.py +++ b/src/python/grpcio_tests/tests/testing/_client_test.py @@ -193,8 +193,10 @@ class ClientTest(unittest.TestCase): rpc.take_request() rpc.take_request() rpc.requests_closed() - rpc.send_initial_metadata(( - ('my_metadata_key', 'My Metadata Value!',),)) + rpc.send_initial_metadata((( + 'my_metadata_key', + 'My Metadata Value!', + ),)) for rpc in rpcs[:-1]: rpc.terminate(_application_common.STREAM_UNARY_RESPONSE, (), grpc.StatusCode.OK, '') diff --git a/src/python/grpcio_tests/tests/testing/_server_application.py b/src/python/grpcio_tests/tests/testing/_server_application.py index 06f09c8cb4..02769ca68d 100644 --- a/src/python/grpcio_tests/tests/testing/_server_application.py +++ b/src/python/grpcio_tests/tests/testing/_server_application.py @@ -41,8 +41,10 @@ class FirstServiceServicer(services_pb2_grpc.FirstServiceServicer): yield services_pb2.Strange() def StreUn(self, request_iterator, context): - context.send_initial_metadata(( - ('server_application_metadata_key', 'Hi there!',),)) + context.send_initial_metadata((( + 'server_application_metadata_key', + 'Hi there!', + ),)) for request in request_iterator: if request != _application_common.STREAM_UNARY_REQUEST: context.set_code(grpc.StatusCode.INVALID_ARGUMENT) diff --git a/src/python/grpcio_tests/tests/testing/_server_test.py b/src/python/grpcio_tests/tests/testing/_server_test.py index 7897bcce01..4f4abd7708 100644 --- a/src/python/grpcio_tests/tests/testing/_server_test.py +++ b/src/python/grpcio_tests/tests/testing/_server_test.py @@ -110,14 +110,19 @@ class FirstServiceServicerTest(unittest.TestCase): second_termination = rpc.termination() third_termination = rpc.termination() - for later_initial_metadata in (second_initial_metadata, - third_initial_metadata,): + for later_initial_metadata in ( + second_initial_metadata, + third_initial_metadata, + ): self.assertEqual(first_initial_metadata, later_initial_metadata) response = first_termination[0] terminal_metadata = first_termination[1] code = first_termination[2] details = first_termination[3] - for later_termination in (second_termination, third_termination,): + for later_termination in ( + second_termination, + third_termination, + ): self.assertEqual(response, later_termination[0]) self.assertEqual(terminal_metadata, later_termination[1]) self.assertIs(code, later_termination[2]) diff --git a/src/python/grpcio_tests/tests/testing/_time_test.py b/src/python/grpcio_tests/tests/testing/_time_test.py index 797394ae20..9dfe36fb83 100644 --- a/src/python/grpcio_tests/tests/testing/_time_test.py +++ b/src/python/grpcio_tests/tests/testing/_time_test.py @@ -105,8 +105,8 @@ class TimeTest(object): test_event.set, _QUANTUM * (2 + random.random())) for _ in range(_MANY): background_noise_futures.append( - self._time.call_in(threading.Event().set, _QUANTUM * 1000 * - random.random())) + self._time.call_in(threading.Event().set, + _QUANTUM * 1000 * random.random())) self._time.sleep_for(_QUANTUM) cancelled = set() for test_event, test_future in possibly_cancelled_futures.items(): |