mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-23819: asyncio: Replace AssertionError with TypeError where it makes sense (GH-29894)
This commit is contained in:
parent
8518ee348c
commit
265918bb1d
5 changed files with 15 additions and 9 deletions
|
@ -255,6 +255,8 @@ class BaseEventLoopTests(test_utils.TestCase):
|
|||
self.assertIsInstance(h, asyncio.TimerHandle)
|
||||
self.assertIn(h, self.loop._scheduled)
|
||||
self.assertNotIn(h, self.loop._ready)
|
||||
with self.assertRaises(TypeError, msg="delay must not be None"):
|
||||
self.loop.call_later(None, cb)
|
||||
|
||||
def test_call_later_negative_delays(self):
|
||||
calls = []
|
||||
|
@ -286,6 +288,8 @@ class BaseEventLoopTests(test_utils.TestCase):
|
|||
# tolerate a difference of +800 ms because some Python buildbots
|
||||
# are really slow
|
||||
self.assertLessEqual(dt, 0.9, dt)
|
||||
with self.assertRaises(TypeError, msg="when cannot be None"):
|
||||
self.loop.call_at(None, cb)
|
||||
|
||||
def check_thread(self, loop, debug):
|
||||
def cb():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue