def test_call_with_no_args(self):
class Object:
def __init__(self):
- self.executor = futures.thread.ThreadPoolExecutor(1)
+ self.executor = futures.ThreadPoolExecutor(1)
@run_on_executor()
def f(self):
def test_call_with_executor(self):
class Object:
def __init__(self):
- self.__executor = futures.thread.ThreadPoolExecutor(1)
+ self.__executor = futures.ThreadPoolExecutor(1)
@run_on_executor(executor="_Object__executor")
def f(self):
def test_async_await(self):
class Object:
def __init__(self):
- self.executor = futures.thread.ThreadPoolExecutor(1)
+ self.executor = futures.ThreadPoolExecutor(1)
@run_on_executor()
def f(self):
def tearDown(self):
self.resolver.close()
+ # ThreadedResolver uses a global thread pool, so we have to shut it down
+ if ThreadedResolver._threadpool is not None:
+ ThreadedResolver._threadpool.shutdown(wait=True)
+ ThreadedResolver._threadpool = None
super().tearDown()