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
778cba7f
Commit
778cba7f
authored
Jul 30, 2013
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18573: More copy-paste fixes to assertWarns entry.
parent
cdc75d96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Doc/library/unittest.rst
Doc/library/unittest.rst
+3
-3
No files found.
Doc/library/unittest.rst
View file @
778cba7f
...
...
@@ -897,12 +897,12 @@ Test cases
Test that a warning is triggered when *callable* is called with any
positional or keyword arguments that are also passed to
:meth:`assertWarns`. The test passes if *warning* is triggered and
fails if it isn't. A
lso, any unexpected
exception is an error.
fails if it isn't. A
ny
exception is an error.
To catch any of a group of warnings, a tuple containing the warning
classes may be passed as *warnings*.
If only the *warning* and possibly the *msg* arguments are given,
return
s
a context manager so that the code under test can be written
return a context manager so that the code under test can be written
inline rather than as a function::
with self.assertWarns(SomeWarning):
...
...
@@ -915,7 +915,7 @@ Test cases
:attr:`warning` attribute, and the source line which triggered the
warnings in the :attr:`filename` and :attr:`lineno` attributes.
This can be useful if the intention is to perform additional checks
on the
exception raised
::
on the
warning caught
::
with self.assertWarns(SomeWarning) as cm:
do_something()
...
...
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