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_warnings fails with -Werror
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: berker.peksag Nosy List: BreamoreBoy, berker.peksag, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2014-12-10 21:51 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue23027.diff berker.peksag, 2015-04-04 09:38 review
Messages (6)
msg232446 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-12-10 21:51
$ ./python -Werror -m test.regrtest -v test_warnings
...
======================================================================
ERROR: test_warning_classes (test.test_warnings.CWarnTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_warnings.py", line 460, in test_warning_classes
    self.module.warn('good warning category', MyWarningClass)
test.test_warnings.WarnTests.test_warning_classes.<locals>.MyWarningClass: good warning category

======================================================================
ERROR: test_warning_classes (test.test_warnings.PyWarnTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_warnings.py", line 460, in test_warning_classes
    self.module.warn('good warning category', MyWarningClass)
  File "/home/serhiy/py/cpython/Lib/warnings.py", line 204, in warn
    globals)
  File "/home/serhiy/py/cpython/Lib/warnings.py", line 249, in warn_explicit
    raise message
test.test_warnings.WarnTests.test_warning_classes.<locals>.MyWarningClass: good warning category

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

This is 3.x only issue.
msg237520 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2015-03-08 08:34
This can be reproduced with 3.5 on Windows 8.1.
msg240054 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-04-04 09:38
Here is a patch.
msg240059 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-04-04 10:11
The patch fixes an error, but produces a warning about changed filters. The patch in issue18383 should fix it.

The patch LGTM, but I left one question on Rietveld.
msg240266 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-04-08 14:38
New changeset e64197dad303 by Berker Peksag in branch 'default':
Issue #23027: test_warnings now passes all tests when run it with -Werror.
https://hg.python.org/cpython/rev/e64197dad303
msg240267 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-04-08 14:42
Removing issue 18383 from dependencies since the bug is also reproducible on the 3.4 branch. This issue only applies to the default branch.
History
Date User Action Args
2022-04-11 14:58:11adminsetgithub: 67216
2015-04-08 14:42:29berker.peksagsetstatus: open -> closed
versions: - Python 3.4
messages: + msg240267

dependencies: - test_warnings modifies warnings.filters when running with "-W default"
resolution: fixed
stage: commit review -> resolved
2015-04-08 14:38:51python-devsetnosy: + python-dev
messages: + msg240266
2015-04-04 10:11:53serhiy.storchakasetdependencies: + test_warnings modifies warnings.filters when running with "-W default"
messages: + msg240059
stage: patch review -> commit review
2015-04-04 09:38:21berker.peksagsetfiles: + issue23027.diff
messages: + msg240054

assignee: berker.peksag
keywords: + patch
stage: needs patch -> patch review
2015-03-31 17:14:07serhiy.storchakalinkissue23829 superseder
2015-03-08 08:34:55BreamoreBoysetnosy: + BreamoreBoy
messages: + msg237520
2014-12-10 22:20:56berker.peksagsetnosy: + berker.peksag

stage: needs patch
2014-12-10 21:51:34serhiy.storchakacreate