Skip to content
Merged
Prev Previous commit
Next Next commit
Rename tests.
  • Loading branch information
serhiy-storchaka committed Dec 6, 2020
commit fe6a4f6d99380a2fbe24652e8003b89c892970e5
8 changes: 4 additions & 4 deletions Lib/test/test_asyncio/test_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ def test_constructor_without_loop(self):
self._new_future()
self.assertEqual(cm.warnings[0].filename, __file__)

def test_constructor_with_running_loop(self):
def test_constructor_use_running_loop(self):
async def test():
return self._new_future()
f = self.loop.run_until_complete(test())
self.assertIs(f._loop, self.loop)
self.assertIs(f.get_loop(), self.loop)

def test_constructor_with_global_loop(self):
def test_constructor_use_global_loop(self):
# Deprecated in 3.10
asyncio.set_event_loop(self.loop)
self.addCleanup(asyncio.set_event_loop, None)
Expand Down Expand Up @@ -500,7 +500,7 @@ def run(arg):
self.assertEqual(cm.warnings[0].filename, __file__)
ex.shutdown(wait=True)

def test_wrap_future_with_running_loop(self):
def test_wrap_future_use_running_loop(self):
def run(arg):
return (arg, threading.get_ident())
ex = concurrent.futures.ThreadPoolExecutor(1)
Expand All @@ -511,7 +511,7 @@ async def test():
self.assertIs(self.loop, f2._loop)
ex.shutdown(wait=True)

def test_wrap_future_with_global_loop(self):
def test_wrap_future_use_global_loop(self):
# Deprecated in 3.10
asyncio.set_event_loop(self.loop)
self.addCleanup(asyncio.set_event_loop, None)
Expand Down
8 changes: 4 additions & 4 deletions Lib/test/test_asyncio/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def test_streamreader_constructor_without_loop(self):
asyncio.StreamReader()
self.assertEqual(cm.warnings[0].filename, __file__)

def test_streamreader_constructor_with_running_loop(self):
def test_streamreader_constructor_use_running_loop(self):
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
# retrieves the current loop if the loop parameter is not set
async def test():
Expand All @@ -761,7 +761,7 @@ async def test():
reader = self.loop.run_until_complete(test())
self.assertIs(reader._loop, self.loop)

def test_streamreader_constructor_with_global_loop(self):
def test_streamreader_constructor_use_global_loop(self):
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
# retrieves the current loop if the loop parameter is not set
# Deprecated in 3.10
Expand All @@ -780,7 +780,7 @@ def test_streamreaderprotocol_constructor_without_loop(self):
asyncio.StreamReaderProtocol(reader)
self.assertEqual(cm.warnings[0].filename, __file__)

def test_streamreaderprotocol_constructor_with_running_loop(self):
def test_streamreaderprotocol_constructor_use_running_loop(self):
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
# retrieves the current loop if the loop parameter is not set
reader = mock.Mock()
Expand All @@ -789,7 +789,7 @@ async def test():
protocol = self.loop.run_until_complete(test())
self.assertIs(protocol._loop, self.loop)

def test_streamreaderprotocol_constructor_with_global_loop(self):
def test_streamreaderprotocol_constructor_use_global_loop(self):
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
# retrieves the current loop if the loop parameter is not set
# Deprecated in 3.10
Expand Down
36 changes: 18 additions & 18 deletions Lib/test/test_asyncio/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ async def coro():
list(futs)
self.assertEqual(cm.warnings[0].filename, __file__)

def test_as_completed_nontask_with_running_loop(self):
def test_as_completed_nontask_use_running_loop(self):
loop = self.new_test_loop()

async def coro():
Expand All @@ -1773,7 +1773,7 @@ async def test():

loop.run_until_complete(test())

def test_as_completed_nontask_with_global_loop(self):
def test_as_completed_nontask_use_global_loop(self):
# Deprecated in 3.10
async def coro():
return 42
Expand Down Expand Up @@ -2258,7 +2258,7 @@ async def coro():
asyncio.shield(inner)
self.assertEqual(cm.warnings[0].filename, __file__)

def test_shield_coroutine_with_running_loop(self):
def test_shield_coroutine_use_running_loop(self):
async def coro():
return 42

Expand All @@ -2269,7 +2269,7 @@ async def test():
res = self.loop.run_until_complete(outer)
self.assertEqual(res, 42)

def test_shield_coroutine_with_global_loop(self):
def test_shield_coroutine_use_global_loop(self):
# Deprecated in 3.10
async def coro():
return 42
Expand Down Expand Up @@ -3413,7 +3413,7 @@ def test_constructor_empty_sequence_without_loop(self):
self._check_empty_sequence_without_loop(set())
self._check_empty_sequence_without_loop(iter(""))

def _check_empty_sequence_with_running_loop(self, seq_or_iter):
def _check_empty_sequence_use_running_loop(self, seq_or_iter):
async def gather():
return asyncio.gather(*seq_or_iter)
fut = self.one_loop.run_until_complete(gather())
Expand All @@ -3423,13 +3423,13 @@ async def gather():
self.assertTrue(fut.done())
self.assertEqual(fut.result(), [])

def test_constructor_empty_sequence_with_running_loop(self):
self._check_empty_sequence_with_running_loop([])
self._check_empty_sequence_with_running_loop(())
self._check_empty_sequence_with_running_loop(set())
self._check_empty_sequence_with_running_loop(iter(""))
def test_constructor_empty_sequence_use_running_loop(self):
self._check_empty_sequence_use_running_loop([])
self._check_empty_sequence_use_running_loop(())
self._check_empty_sequence_use_running_loop(set())
self._check_empty_sequence_use_running_loop(iter(""))

def _check_empty_sequence_with_global_loop(self, seq_or_iter):
def _check_empty_sequence_use_global_loop(self, seq_or_iter):
with self.assertWarns(DeprecationWarning) as cm:
fut = asyncio.gather(*seq_or_iter)
self.assertEqual(cm.warnings[0].filename, __file__)
Expand All @@ -3439,14 +3439,14 @@ def _check_empty_sequence_with_global_loop(self, seq_or_iter):
self.assertTrue(fut.done())
self.assertEqual(fut.result(), [])

def test_constructor_empty_sequence_with_global_loop(self):
def test_constructor_empty_sequence_use_global_loop(self):
# Deprecated in 3.10
asyncio.set_event_loop(self.one_loop)
self.addCleanup(asyncio.set_event_loop, None)
self._check_empty_sequence_with_global_loop([])
self._check_empty_sequence_with_global_loop(())
self._check_empty_sequence_with_global_loop(set())
self._check_empty_sequence_with_global_loop(iter(""))
self._check_empty_sequence_use_global_loop([])
self._check_empty_sequence_use_global_loop(())
self._check_empty_sequence_use_global_loop(set())
self._check_empty_sequence_use_global_loop(iter(""))

def test_constructor_heterogenous_futures(self):
fut1 = self.one_loop.create_future()
Expand Down Expand Up @@ -3534,7 +3534,7 @@ async def coro():
asyncio.gather(gen1, gen2)
self.assertEqual(cm.warnings[0].filename, __file__)

def test_constructor_with_running_loop(self):
def test_constructor_use_running_loop(self):
async def coro():
return 'abc'
gen1 = coro()
Expand All @@ -3545,7 +3545,7 @@ async def gather():
self.assertIs(fut._loop, self.one_loop)
self.one_loop.run_until_complete(fut)

def test_constructor_with_global_loop(self):
def test_constructor_use_global_loop(self):
# Deprecated in 3.10
async def coro():
return 'abc'
Expand Down