Skip to content

Commit

Permalink
test the deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Oct 11, 2023
1 parent 5c5ce69 commit 43cbdb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2690,7 +2690,8 @@ def test_set_event_loop_policy(self):
old_policy = asyncio.get_event_loop_policy()

policy = asyncio.DefaultEventLoopPolicy()
asyncio.set_event_loop_policy(policy)
with self.assertWarns(DeprecationWarning) as cm:
asyncio.set_event_loop_policy(policy)
self.assertIs(policy, asyncio.get_event_loop_policy())
self.assertIsNot(policy, old_policy)

Expand Down

0 comments on commit 43cbdb2

Please sign in to comment.