diff options
author | Kumar Aditya <rahuladitya303@gmail.com> | 2021-12-06 23:40:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-06 23:40:35 (GMT) |
commit | 265918bb1d782ab85c7dbc835eb62d6cfc2145b7 (patch) | |
tree | d3f63cd07b8465aed76dfc04839d388c28bf87c2 /Lib/test/test_asyncio/test_events.py | |
parent | 8518ee348c18da7e150f5e42b3424c86f7c0a3d8 (diff) | |
download | cpython-265918bb1d782ab85c7dbc835eb62d6cfc2145b7.zip cpython-265918bb1d782ab85c7dbc835eb62d6cfc2145b7.tar.gz cpython-265918bb1d782ab85c7dbc835eb62d6cfc2145b7.tar.bz2 |
bpo-23819: asyncio: Replace AssertionError with TypeError where it makes sense (GH-29894)
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index e50a53d..fe791fa 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -2322,10 +2322,6 @@ class TimerTests(unittest.TestCase): self.assertIsNone(h._callback) self.assertIsNone(h._args) - # when cannot be None - self.assertRaises(AssertionError, - asyncio.TimerHandle, None, callback, args, - self.loop) def test_timer_repr(self): self.loop.get_debug.return_value = False @@ -2592,7 +2588,7 @@ class PolicyTests(unittest.TestCase): policy = asyncio.DefaultEventLoopPolicy() old_loop = policy.get_event_loop() - self.assertRaises(AssertionError, policy.set_event_loop, object()) + self.assertRaises(TypeError, policy.set_event_loop, object()) loop = policy.new_event_loop() policy.set_event_loop(loop) @@ -2608,7 +2604,7 @@ class PolicyTests(unittest.TestCase): def test_set_event_loop_policy(self): self.assertRaises( - AssertionError, asyncio.set_event_loop_policy, object()) + TypeError, asyncio.set_event_loop_policy, object()) old_policy = asyncio.get_event_loop_policy() |