This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients brett.cannon, gvanrossum, vstinner, yselivanov
Date 2021-11-27.23:58:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638057481.7.0.675267362223.issue23819@roundup.psfhosted.org>
In-reply-to
Content
I'm sure there's more to it, but I found at least this failure:

~/cpython$ ./python.exe -O -m test test_asyncio -m test_set_event_loop
Raised RLIMIT_NOFILE: 256 -> 1024
0:00:00 load avg: 2.02 Run tests sequentially
0:00:00 load avg: 2.02 [1/1] test_asyncio
test test_asyncio failed -- Traceback (most recent call last):
  File "/Users/guido/cpython/Lib/test/test_asyncio/test_events.py", line 2595, in test_set_event_loop
    self.assertRaises(AssertionError, policy.set_event_loop, object())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: AssertionError not raised by set_event_loop

test_asyncio failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_asyncio

Total duration: 134 ms
Tests result: FAILURE


Also this one:

~/cpython$ ./python.exe -O -m test test_asyncio -m test_create_datagram_endpoint_addr_error
0:00:00 load avg: 2.19 Run tests sequentially
0:00:00 load avg: 2.19 [1/1] test_asyncio
test test_asyncio failed -- Traceback (most recent call last):
  File "/Users/guido/cpython/Lib/test/test_asyncio/test_base_events.py", line 1593, in test_create_datagram_endpoint_addr_error
    self.assertRaises(
    ^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/unittest/case.py", line 734, in assertRaises
    return context.handle('assertRaises', args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/unittest/case.py", line 218, in handle
    callable_obj(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 637, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 1287, in create_datagram_endpoint
    infos = await self._ensure_resolved(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 1369, in _ensure_resolved
    info = _ipaddr_info(host, port, family, type, proto, *address[2:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _ipaddr_info() takes from 5 to 7 positional arguments but 12 were given

test_asyncio failed (1 error)

== Tests result: FAILURE ==

1 test failed:
    test_asyncio

Total duration: 165 ms
Tests result: FAILURE


I think calling assertRaises(AssertionError, ...) is definitely an anti-pattern. We can't remove all assertions from the asyncio library, but I think the ones that are explicitly checked for by the tests should go, at least. (Probably replaced with TypeError or ValueError in most cases.)
History
Date User Action Args
2021-11-27 23:58:01gvanrossumsetrecipients: + gvanrossum, brett.cannon, vstinner, yselivanov
2021-11-27 23:58:01gvanrossumsetmessageid: <1638057481.7.0.675267362223.issue23819@roundup.psfhosted.org>
2021-11-27 23:58:01gvanrossumlinkissue23819 messages
2021-11-27 23:58:01gvanrossumcreate