Skip to content

Commit

Permalink
Suppress DeprecationWarning until root cause can be addressed. Ref #197.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 20, 2022
1 parent 4634d13 commit 676d240
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion irc/tests/test_client_aio.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import warnings
import contextlib
from unittest.mock import MagicMock
import asyncio

Expand All @@ -11,13 +13,21 @@ async def mock_create_connection(*args, **kwargs):
return mock_create_connection


@contextlib.contextmanager
def suppress_issue_197():
with warnings.catch_warnings():
warnings.filterwarnings('ignore', 'There is no current event loop')
yield


def test_privmsg_sends_msg():
# create dummy transport, protocol
mock_transport = MagicMock()
mock_protocol = MagicMock()

# connect to dummy server
loop = asyncio.get_event_loop()
with suppress_issue_197():
loop = asyncio.get_event_loop()
loop.create_connection = make_mocked_create_connection(
mock_transport, mock_protocol
)
Expand Down

0 comments on commit 676d240

Please sign in to comment.