From cc793703bfba6f661f523b6fec82ff8a913e1759 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Fri, 13 Jan 2017 19:20:10 -0800 Subject: Run Python formatting --- src/python/grpcio_tests/tests/unit/_thread_pool.py | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/python/grpcio_tests/tests/unit/_thread_pool.py') diff --git a/src/python/grpcio_tests/tests/unit/_thread_pool.py b/src/python/grpcio_tests/tests/unit/_thread_pool.py index f13cc2f86f..fad2e1c8f6 100644 --- a/src/python/grpcio_tests/tests/unit/_thread_pool.py +++ b/src/python/grpcio_tests/tests/unit/_thread_pool.py @@ -32,17 +32,18 @@ from concurrent import futures class RecordingThreadPool(futures.Executor): - """A thread pool that records if used.""" - def __init__(self, max_workers): - self._tp_executor = futures.ThreadPoolExecutor(max_workers=max_workers) - self._lock = threading.Lock() - self._was_used = False + """A thread pool that records if used.""" - def submit(self, fn, *args, **kwargs): - with self._lock: - self._was_used = True - self._tp_executor.submit(fn, *args, **kwargs) + def __init__(self, max_workers): + self._tp_executor = futures.ThreadPoolExecutor(max_workers=max_workers) + self._lock = threading.Lock() + self._was_used = False - def was_used(self): - with self._lock: - return self._was_used + def submit(self, fn, *args, **kwargs): + with self._lock: + self._was_used = True + self._tp_executor.submit(fn, *args, **kwargs) + + def was_used(self): + with self._lock: + return self._was_used -- cgit v1.2.3