Issue33912
Created on 2018-06-20 09:59 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 7839 | merged | chrisfrederickson, 2018-06-21 03:26 | |
| Messages (5) | |||
|---|---|---|---|
| msg320044 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2018-06-20 09:59 | |
vstinner@apu$ ./python -W error -m test -v test_warnings ====================================================================== ERROR: test_exec_filename (test.test_warnings.CWarnTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/test/test_warnings/__init__.py", line 450, in test_exec_filename exec(codeobj) File "<warnings-test>", line 2, in <module> UserWarning: hello ====================================================================== ERROR: test_exec_filename (test.test_warnings.PyWarnTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/test/test_warnings/__init__.py", line 450, in test_exec_filename exec(codeobj) File "<warnings-test>", line 2, in <module> File "/home/vstinner/prog/python/master/Lib/warnings.py", line 318, in warn globals, source) File "/home/vstinner/prog/python/master/Lib/warnings.py", line 363, in warn_explicit raise message UserWarning: hello It seems to be a regression introduced by bpo-33375: commit 11a896652ee98aa44e59ed25237f9efb56635dcf. |
|||
| msg320046 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2018-06-20 10:01 | |
I consider that this issue is easy, core developers/long time contriubtors: please don't fix it, but explain how to fix it and let a newcomer to fix it! https://mail.python.org/pipermail/python-committers/2017-June/004564.html |
|||
| msg320050 - (view) | Author: Thomas Kluyver (takluyver) * | Date: 2018-06-20 10:12 | |
Yes, this should be easy. I misunderstood how to use the catch_warnings context manager. I thought that catch_warnings itself set up the warnings filters you need. You actually need to do that with a separate call inside the with block, as shown here: https://docs.python.org/3/library/warnings.html#testing-warnings |
|||
| msg320194 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2018-06-21 16:13 | |
New changeset 419e88d18ccc83e182afca124d42f46794022aab by Victor Stinner (Christopher Frederickson) in branch 'master': bpo-33912: Fix test_warnings when run with -Werror (GH-7839) https://github.com/python/cpython/commit/419e88d18ccc83e182afca124d42f46794022aab |
|||
| msg320195 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2018-06-21 16:14 | |
Thank you Christopher Frederickson for your contribution! I merged your PR. I confirm that it fixes the issue. Thanks Thomas Kluyver for the hints ;-) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:01 | admin | set | github: 78093 |
| 2018-06-21 16:14:30 | vstinner | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-06-21 16:14:17 | vstinner | set | messages: + msg320195 |
| 2018-06-21 16:13:03 | vstinner | set | messages: + msg320194 |
| 2018-06-21 03:26:44 | chrisfrederickson | set | keywords:
+ patch stage: patch review pull_requests: + pull_request7448 |
| 2018-06-20 18:06:27 | brett.cannon | set | nosy:
+ brett.cannon |
| 2018-06-20 10:12:27 | takluyver | set | messages: + msg320050 |
| 2018-06-20 10:08:28 | serhiy.storchaka | set | nosy:
+ takluyver |
| 2018-06-20 10:01:06 | vstinner | set | messages: + msg320046 |
| 2018-06-20 09:59:24 | vstinner | create | |
