Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b8e973f9
Commit
b8e973f9
authored
Apr 08, 2015
by
Berker Peksag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23027: test_warnings now passes all tests when run it with -Werror.
parent
d0962083
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
Lib/test/test_warnings.py
Lib/test/test_warnings.py
+14
-11
No files found.
Lib/test/test_warnings.py
View file @
b8e973f9
...
...
@@ -456,17 +456,20 @@ class WarnTests(BaseTest):
self
.
assertIn
(
'category must be a Warning subclass, not '
,
str
(
cm
.
exception
))
with
self
.
assertWarns
(
MyWarningClass
)
as
cm
:
self
.
module
.
warn
(
'good warning category'
,
MyWarningClass
)
self
.
assertEqual
(
'good warning category'
,
str
(
cm
.
warning
))
with
self
.
assertWarns
(
UserWarning
)
as
cm
:
self
.
module
.
warn
(
'good warning category'
,
None
)
self
.
assertEqual
(
'good warning category'
,
str
(
cm
.
warning
))
with
self
.
assertWarns
(
MyWarningClass
)
as
cm
:
self
.
module
.
warn
(
'good warning category'
,
MyWarningClass
)
self
.
assertIsInstance
(
cm
.
warning
,
Warning
)
with
original_warnings
.
catch_warnings
(
module
=
self
.
module
):
self
.
module
.
resetwarnings
()
self
.
module
.
filterwarnings
(
'default'
)
with
self
.
assertWarns
(
MyWarningClass
)
as
cm
:
self
.
module
.
warn
(
'good warning category'
,
MyWarningClass
)
self
.
assertEqual
(
'good warning category'
,
str
(
cm
.
warning
))
with
self
.
assertWarns
(
UserWarning
)
as
cm
:
self
.
module
.
warn
(
'good warning category'
,
None
)
self
.
assertEqual
(
'good warning category'
,
str
(
cm
.
warning
))
with
self
.
assertWarns
(
MyWarningClass
)
as
cm
:
self
.
module
.
warn
(
'good warning category'
,
MyWarningClass
)
self
.
assertIsInstance
(
cm
.
warning
,
Warning
)
class
CWarnTests
(
WarnTests
,
unittest
.
TestCase
):
module
=
c_warnings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment