Review comments

pull/23107/head
Richard Belleville 5 years ago
parent 420584462f
commit a0e23e2123
  1. 1
      src/python/grpcio/grpc/_cython/_cygrpc/thread.pyx.pxi
  2. 13
      src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py

@ -43,7 +43,6 @@ def _run_with_context(target):
A callable object with the same signature as `target` but with
contextvars propagated.
"""
pass
if _contextvars_supported():

@ -72,13 +72,10 @@ if contextvars_supported():
class TestCallCredentials(grpc.AuthMetadataPlugin):
def __init__(self):
self._recorded_value = None
self._invoked = False
def __call__(self, context, callback):
self._recorded_value = test_var.get()
self._invoked = True
if test_var.get() != _EXPECTED_VALUE:
raise AssertionError("{} != {}".format(test_var.get(),
_EXPECTED_VALUE))
callback((), None)
def assert_called(self, test):
@ -95,9 +92,6 @@ else:
def __call__(self, context, callback):
callback((), None)
def assert_called(self, test):
pass
# TODO(https://github.com/grpc/grpc/issues/22257)
@unittest.skipIf(os.name == "nt", "LocalCredentials not supported on Windows.")
@ -117,7 +111,6 @@ class ContextVarsPropagationTest(unittest.TestCase):
stub = channel.unary_unary(_UNARY_UNARY)
response = stub(_REQUEST, wait_for_ready=True)
self.assertEqual(_REQUEST, response)
test_call_credentials.assert_called(self)
if __name__ == '__main__':

Loading…
Cancel
Save