Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 committed Dec 24, 2024
1 parent 707db0f commit 962bd63
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2695,6 +2695,14 @@ async def inner():

class PolicyTests(unittest.TestCase):

def test_asyncio_set_event_loop_deprecation(self):
with self.assertWarnsRegex(
DeprecationWarning, "'asyncio.set_event_loop' is deprecated"):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
self.assertIs(loop, asyncio.get_event_loop())
loop.close()

def test_abstract_event_loop_policy_deprecation(self):
with self.assertWarnsRegex(
DeprecationWarning, "'asyncio.AbstractEventLoopPolicy' is deprecated"):
Expand Down

0 comments on commit 962bd63

Please sign in to comment.