Guido van Rossum <gu...@python.org> added the comment:

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.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to