In tests DeprecationWarning no event loop

Open
#197 0 comments 0 reactions 0 assignees View on GitHub

@WOnder93 is already working on this.

Since Nov 23, 2024.

  • #236 by @WOnder93 — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
testing

Research direction

Start with irc/tests/test_client_aio.py, especially test_privmsg_sends_msg and its asyncio.get_event_loop() call. Run tox -- -We -k aio to reproduce the Python 3.10 DeprecationWarning; done means the aio test selection passes without that warning.

Written by the indexing model from the issue text.

Description

help wanted
irc main $ tox -- -We -k aio
python develop-inst-noop: /Users/jaraco/code/main/irc
python installed: attrs==21.4.0,black==21.12b0,click==8.0.3,coverage==6.2,docutils==0.18.1,filelock==3.4.2,flake8==4.0.1,importlib-metadata==4.10.0,iniconfig==1.1.1,-e git+gh://jaraco/irc@4634d134c9994b87001813c91292fdeb591bb5ab#egg=irc,jaraco.classes==3.2.1,jaraco.collections==3.4.0,jaraco.context==4.1.1,jaraco.functools==3.5.0,jaraco.logging==3.1.0,jaraco.stream==3.0.3,jaraco.text==3.6.0,mccabe==0.6.1,more-itertools==8.12.0,mypy==0.930,mypy-extensions==0.4.3,packaging==21.3,pathspec==0.9.0,pep517==0.12.0,platformdirs==2.4.1,pluggy==1.0.0,py==1.11.0,pycodestyle==2.8.0,pyflakes==2.4.0,Pygments==2.11.1,pyparsing==3.0.6,pytest==6.2.5,pytest-black==0.3.12,pytest-checkdocs==2.7.1,pytest-cov==3.0.0,pytest-enabler==1.2.1,pytest-flake8==1.0.7,pytest-mypy==0.8.1,pytz==2021.3,tempora==4.1.2,toml==0.10.2,tomli==1.2.3,typing_extensions==4.0.1,zipp==3.7.0
python run-test-pre: PYTHONHASHSEED='3118046128'
python run-test: commands[0] | pytest -We -k aio
====================================================================== test session starts =======================================================================
platform darwin -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
cachedir: .tox/python/.pytest_cache
rootdir: /Users/jaraco/code/main/irc, configfile: pytest.ini
plugins: flake8-1.0.7, enabler-1.2.1, checkdocs-2.7.1, black-0.3.12, mypy-0.8.1, cov-3.0.0
collected 127 items / 113 deselected / 14 selected                                                                                                               

irc/client_aio.py .ss                                                                                                                                      [ 23%]
irc/tests/test_client_aio.py .ssF                                                                                                                          [ 53%]
scripts/irccat-aio.py .ss                                                                                                                                  [ 76%]
scripts/irccat2-aio.py .ss                                                                                                                                 [100%]

============================================================================ FAILURES ============================================================================
_____________________________________________________________________ test_privmsg_sends_msg _____________________________________________________________________

    def test_privmsg_sends_msg():
        # create dummy transport, protocol
        mock_transport = MagicMock()
        mock_protocol = MagicMock()
    
        # connect to dummy server
>       loop = asyncio.get_event_loop()
E       DeprecationWarning: There is no current event loop

irc/tests/test_client_aio.py:20: DeprecationWarning

---------- coverage: platform darwin, python 3.10.1-final-0 ----------
Name                           Stmts   Miss  Cover   Missing
------------------------------------------------------------
conftest.py                        8      3    62%   8-10
docs/conf.py                      12      0   100%
irc/__init__.py                    9      5    44%   5-6, 10-12
irc/bot.py                       229    147    36%   40-42, 45, 53-55, 90-108, 111-114, 160-179, 185-196, 199-200, 203-207, 210-216, 219-228, 239-256, 259-263, 266-272, 275-278, 288-289, 300, 308, 316-320, 328-338, 341, 345-346, 361-363, 367, 371, 376, 380, 384, 388, 392, 396, 400, 404, 408, 412, 415, 419-421, 424-425, 428-431, 434-435, 446-449, 460-466, 469, 472, 475, 478, 481, 484, 487, 490, 493-496, 499
irc/client.py                    569    393    31%   105, 109, 133-134, 166-197, 203, 213-215, 223, 232, 239-244, 249-268, 271-299, 302-343, 346-366, 370-372, 376-379, 386, 393, 400, 404, 408, 426-446, 450-452, 456, 465-478, 482, 486, 490, 499, 503, 507, 511, 515, 519, 523, 527, 531, 535, 540, 544, 548, 552, 556, 560, 564, 568-569, 575, 580-589, 595, 602-610, 614, 618, 622, 626, 630, 634-635, 639, 643, 647, 651, 655, 659, 663, 670, 678-679, 685, 738, 757-769, 774-777, 788-792, 799-800, 804-805, 823-830, 844-846, 850-852, 875-878, 890-896, 908-911, 917-924, 928-930, 959-960, 972-983, 995-1006, 1015-1029, 1034-1085, 1093-1095, 1101-1105, 1143-1147, 1153-1159, 1162, 1166, 1174-1176, 1189-1190, 1197-1198, 1202, 1227-1235, 1238-1245, 1253, 1266-1268, 1279-1281, 1318, 1322-1323, 1327-1328, 1332-1334, 1338-1340, 1344, 1349
irc/client_aio.py                 83     58    30%   74-75, 78, 81-82, 140-171, 179-186, 193-197, 205-214, 255, 258-268, 278, 295
irc/connection.py                 23      7    70%   7, 52, 55-58, 96
irc/ctcp.py                       25     16    36%   18-22, 41-49, 53-70
irc/dict.py                        9      3    67%   45-47
irc/events.py                      5      0   100%
irc/features.py                   51     31    39%   27, 31, 35, 38-39, 43-44, 48-62, 67-69, 74, 83, 96-97, 105-107, 111-113
irc/message.py                    27     19    30%   27-34, 41-44, 71-79
irc/modes.py                      17     14    18%   14, 29, 74-89
irc/rfc.py                        20     11    45%   5-7, 15-16, 20-21, 25, 29-30, 34
irc/schedule.py                   18      3    83%   32, 35, 38
irc/server.py                    281    224    20%   72-73, 76, 80, 89-92, 108-115, 118-125, 131-145, 148-159, 162-187, 190-197, 203-250, 256-265, 271-272, 279-319, 325, 331, 337-361, 368-370, 376-395, 401-415, 421-427, 433-442, 445-457, 463, 473-484, 490, 510-514, 518-537, 541-554, 558
irc/strings.py                     8      2    75%   29, 38
irc/tests/__init__.py              0      0   100%
irc/tests/test_bot.py             92     64    30%   16-19, 22-25, 28-31, 34-39, 44-49, 52-54, 57-59, 62-67, 70-76, 85, 94-101, 106-114, 122-125, 132-143, 147
irc/tests/test_client.py          29     17    41%   9, 14-20, 25-28, 36-39, 45-47
irc/tests/test_client_aio.py      17      9    47%   8-11, 21-30
scripts/dccreceive.py             57     40    30%   25-26, 29-42, 45-48, 51-53, 56, 60-68, 72-81, 85
scripts/dccsend.py                65     46    29%   22-27, 30-42, 45-48, 51-52, 55-60, 63, 66-67, 70-72, 76-85, 89-98, 102
scripts/irccat2-aio.py            52     37    29%   18-19, 22-25, 30, 35-36, 39-47, 51-58, 62-78, 82
scripts/irccat2.py                46     36    22%   16-17, 20-23, 26, 29, 32-37, 41-65, 69
scripts/irccat-aio.py             55     39    29%   21-23, 27, 33-34, 38-43, 47, 51-58, 64-92, 96
scripts/irccat.py                 48     33    31%   22-25, 29, 33-34, 38-41, 45, 49-55, 61-76, 80
scripts/servermap.py              75     61    19%   53-55, 59-60, 66, 72-92, 96, 100-112, 116-121, 125-130, 136-156, 160
scripts/ssl-cat.py                47     32    32%   22-25, 29, 33-34, 38-41, 45, 49-54, 60-77, 81
scripts/testbot.py                74     59    20%   35-36, 39, 42, 45, 48-53, 57-58, 61-70, 73-99, 103-123, 127
------------------------------------------------------------
TOTAL                           2051   1409    31%

============================================================================== mypy ==============================================================================
Success: no issues found in 4 source files
==================================================================== short test summary info =====================================================================
FAILED irc/tests/test_client_aio.py::test_privmsg_sends_msg - DeprecationWarning: There is no current event loop
===================================================== 1 failed, 4 passed, 8 skipped, 113 deselected in 2.68s =====================================================
ERROR: InvocationError for command /Users/jaraco/code/main/irc/.tox/python/bin/pytest -We -k aio (exited with code 1)
____________________________________________________________________________ summary _____________________________________________________________________________
ERROR:   python: commands failed
Dominant language
Python
Stars
422
Forks
91
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jaraco/irc

All issues in jaraco/irc

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.