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.

classification
Title: test_coroutines is failed when run with -We
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: njs, serhiy.storchaka, yselivanov
Priority: normal Keywords: patch

Created on 2018-01-31 18:29 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5487 merged njs, 2018-02-02 03:42
PR 5490 merged miss-islington, 2018-02-02 05:10
Messages (9)
msg311354 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-01-31 18:29
$ ./python -We -m test test_coroutines
Run tests sequentially
0:00:00 load avg: 0.29 [1/1] test_coroutines
Exception ignored in: <coroutine object OriginTrackingTest.test_origin_tracking_warning.<locals>.corofn at 0x7fc5fc692cb8>
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/warnings.py", line 511, in _warn_unawaited_coroutine
    warn(msg, category=RuntimeWarning, stacklevel=2, source=coro)
RuntimeWarning: coroutine 'OriginTrackingTest.test_origin_tracking_warning.<locals>.corofn' was never awaited
test test_coroutines failed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_coroutines.py", line 2167, in test_origin_tracking_warning
    msg = check(0, f"coroutine '{corofn.__qualname__}' was never awaited")
  File "/home/serhiy/py/cpython/Lib/test/test_coroutines.py", line 2161, in check
    self.assertTrue(len(wlist) == 1)
AssertionError: False is not true

test_coroutines failed

1 test failed:
    test_coroutines

Total duration: 371 ms
Tests result: FAILURE

This isn't release blocker, because the test is failed, not crashed, and seems this is just a test issue.
msg311355 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-31 18:33
Nathaniel, this seems to be related to coro-origin-tracking.
msg311367 - (view) Author: Nathaniel Smith (njs) * (Python committer) Date: 2018-01-31 20:44
Ok, yeah, that's a test that a warning is emitted, which fails when the warning is converted into an error instead. Need to normalize the warnings filter settings inside that test, I guess.

How does this not cause the same problem for every other test that uses assertWarns though?
msg311368 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-31 20:48
I think assertWarns just handles it. Maybe the test should be converted to use it?
msg311369 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-31 20:50
Or to use assertWarnsRegex
msg311475 - (view) Author: Nathaniel Smith (njs) * (Python committer) Date: 2018-02-02 04:55
New changeset 2efb9735899c7c642f3e75a121af82b1679577d3 by Nathaniel J. Smith in branch 'master':
bpo-32733: Make test_coroutines robust against -Werror (GH-5487)
https://github.com/python/cpython/commit/2efb9735899c7c642f3e75a121af82b1679577d3
msg311477 - (view) Author: Nathaniel Smith (njs) * (Python committer) Date: 2018-02-02 05:57
New changeset 709f6ad7f84855ebdbe3e7702571b0e1447b885b by Nathaniel J. Smith (Miss Islington (bot)) in branch '3.7':
bpo-32733: Make test_coroutines robust against -Werror (GH-5487) (GH-5490)
https://github.com/python/cpython/commit/709f6ad7f84855ebdbe3e7702571b0e1447b885b
msg311480 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-02-02 06:42
Thank you Nathaniel. And congratulate with getting core developer status!
msg311481 - (view) Author: Nathaniel Smith (njs) * (Python committer) Date: 2018-02-02 06:49
Thanks!
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 76914
2018-02-02 06:49:16njssetstatus: open -> closed
resolution: fixed
messages: + msg311481

stage: patch review -> resolved
2018-02-02 06:42:49serhiy.storchakasetmessages: + msg311480
2018-02-02 05:57:31njssetmessages: + msg311477
2018-02-02 05:10:05miss-islingtonsetpull_requests: + pull_request5320
2018-02-02 04:55:57njssetmessages: + msg311475
2018-02-02 03:42:29njssetkeywords: + patch
stage: patch review
pull_requests: + pull_request5317
2018-01-31 20:50:05yselivanovsetmessages: + msg311369
2018-01-31 20:48:59yselivanovsetmessages: + msg311368
2018-01-31 20:44:35njssetmessages: + msg311367
2018-01-31 18:33:18yselivanovsetnosy: + njs
messages: + msg311355
2018-01-31 18:29:07serhiy.storchakacreate