Exemple #1
0
 def setUp(self):
     super().setUp()
     import asyncio
     from tests.unit.asynchronous.blocking_call import slow
     self.target = slow
     self.loop = asyncio.get_event_loop()
     self.AsyncWrapper = AsyncWrapper(concurrency_provider=self.loop,
                                      func=self.target)
Exemple #2
0
 def setUp(self):
     super().setUp()
     # if we wanted to, we could make our AsyncWrapper use ThreadPools in python3.
     from tests.unit.asynchronous.blocking_call import slow
     self.target = slow
     tp = pool.ThreadPool(processes=1)
     self.AsyncWrapper = AsyncWrapper(concurrency_provider=tp,
                                      func=self.target)
Exemple #3
0
 def setUp(self):
     super().setUp()
     import asyncio
     self.loop = asyncio.new_event_loop()
     self.AsyncWrapper = AsyncWrapper(concurrency_provider=self.loop,
                                      func=self.target)
Exemple #4
0
 def setUp(self):
     super(Test2CustomLoop, self).setUp()
     from tests.unit.asynchronous.blocking_call import slow
     tp = pool.ThreadPool(processes=1)
     self.AsyncWrapper = AsyncWrapper(concurrency_provider=tp, func=slow)
Exemple #5
0
 def setUp(self):
     super(Test2, self).setUp()
     from tests.unit.asynchronous.blocking_call import slow
     self.AsyncWrapper = AsyncWrapper(func=slow)
Exemple #6
0
 def setUp(self):
     super().setUp()
     import asyncio
     # silly us, we used a different loop compared to our testing code! this won't work.
     self.AsyncWrapper = AsyncWrapper(
         concurrency_provider=asyncio.new_event_loop(), func=self.target)