classification
Title: test_asyncio raises a deprecation warning
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: test_asyncio emits ResourceWarning warnings
View: 33789
Assigned To: Nosy List: asvetlov, ned.deily, serhiy.storchaka, vstinner, yselivanov
Priority: high Keywords:

Created on 2018-06-03 07:41 by serhiy.storchaka, last changed 2018-06-07 14:23 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7481 closed asvetlov, 2018-06-07 14:16
Messages (7)
msg318524 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-06-03 07:41
$ ./python -We -m test -v -m test__register_task_3 test_asyncio
...
======================================================================
ERROR: test__register_task_3 (test.test_asyncio.test_tasks.CIntrospectionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_tasks.py", line 2616, in test__register_task_3
    self.assertEqual(asyncio.Task.all_tasks(loop), {task})
PendingDeprecationWarning: Task.all_tasks() is deprecated, use asyncio.all_tasks() instead

======================================================================
ERROR: test__register_task_3 (test.test_asyncio.test_tasks.PyIntrospectionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_tasks.py", line 2616, in test__register_task_3
    self.assertEqual(asyncio.Task.all_tasks(loop), {task})
PendingDeprecationWarning: Task.all_tasks() is deprecated, use asyncio.all_tasks() instead

----------------------------------------------------------------------

And the test is failed if run with -We.
msg318900 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-06-07 06:58
Any chance we can get this fixed for 3.7.0rc1?

FWIW, as of current 3.7 head (cebd4b009adca6611e92eb337747f59818e941a6), I am also seeing the following warnings (on macOS 10.13):

./bin/python3.7 -m test -w -uall,-largefile -j3 test_asyncio
Run tests in parallel using 3 child processes
running: test_asyncio (30 sec)
0:00:47 load avg: 1.74 [1/1] test_asyncio passed (47 sec)
.../python3.7/test/test_asyncio/test_sslproto.py:602: ResourceWarning: unclosed <ssl.SSLSocket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 62863), raddr=('127.0.0.1', 62864)>
  pass
.../python3.7/test/test_asyncio/functional.py:272: ResourceWarning: unclosed <socket.socket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 62871), raddr=('127.0.0.1', 62872)>
  self._prog(TestSocketWrapper(sock))
.../python3.7/asyncio/sslproto.py:322: ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x10e092e90>
  source=self)
.../python3.7/test/test_asyncio/test_tasks.py:2612: PendingDeprecationWarning: Task.all_tasks() is deprecated, use asyncio.all_tasks() instead
  self.assertEqual(asyncio.Task.all_tasks(loop), {task})
.../python3.7/test/test_asyncio/test_tasks.py:2612: PendingDeprecationWarning: Task.all_tasks() is deprecated, use asyncio.all_tasks() instead
  self.assertEqual(asyncio.Task.all_tasks(loop), {task})

== Tests result: SUCCESS ==

1 test OK.
msg318931 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-06-07 13:44
Working on it
msg318932 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-07 13:49
That's a duplicate of bpo-33789: I fixed it yesterday in the master branch.
msg318938 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-06-07 14:21
Master already has the fix, added by 7ed61e9431e
msg318940 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-06-07 14:22
Aha, I see.
Thanks
msg318941 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-07 14:23
Andrew Svetlov: "Aha, I see. Thanks"

You're welcome.

Ned Deily: "Any chance we can get this fixed for 3.7.0rc1?"

I just backported my changes to the 3.7 branch.
History
Date User Action Args
2018-06-07 14:23:55vstinnersetmessages: + msg318941
2018-06-07 14:22:29asvetlovsetmessages: + msg318940
2018-06-07 14:21:22asvetlovsetmessages: + msg318938
versions: - Python 3.8
2018-06-07 14:18:15giampaolo.rodolasetnosy: - giampaolo.rodola
2018-06-07 14:17:57vstinnersetpull_requests: - pull_request7103
2018-06-07 14:16:08asvetlovsetpull_requests: + pull_request7105
2018-06-07 14:13:10vstinnersetpull_requests: + pull_request7103
2018-06-07 13:49:26vstinnersetstatus: open -> closed

superseder: test_asyncio emits ResourceWarning warnings

nosy: + vstinner
messages: + msg318932
resolution: duplicate
stage: resolved
2018-06-07 13:44:56asvetlovsetmessages: + msg318931
2018-06-07 06:58:36ned.deilysetpriority: normal -> high
nosy: + ned.deily
messages: + msg318900

2018-06-03 07:41:56serhiy.storchakacreate