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
c730e424
Commit
c730e424
authored
Oct 10, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rolled back revisions 74556 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
parent
4a510d53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
20 deletions
+0
-20
Doc/library/unittest.rst
Doc/library/unittest.rst
+0
-4
Lib/test/test_unittest.py
Lib/test/test_unittest.py
+0
-15
Lib/unittest/case.py
Lib/unittest/case.py
+0
-1
No files found.
Doc/library/unittest.rst
View file @
c730e424
...
...
@@ -891,10 +891,6 @@ Test cases
with self.failUnlessRaises(some_error_class):
do_something()
The context manager will store the caught exception object in its
:attr:`exc_value` attribute. This can be useful if the intention
is to perform additional checks on the exception raised.
.. versionchanged:: 3.1
Added the ability to use :meth:`assertRaises` as a context manager.
...
...
Lib/test/test_unittest.py
View file @
c730e424
...
...
@@ -2846,21 +2846,6 @@ test case
self
.
assertRaisesRegexp
,
Exception
,
re
.
compile
(
'^Expected$'
),
Stub
)
def
testAssertRaisesExcValue
(
self
):
class
ExceptionMock
(
Exception
):
pass
def
Stub
(
foo
):
raise
ExceptionMock
(
foo
)
v
=
"particular value"
ctx
=
self
.
assertRaises
(
ExceptionMock
)
with
ctx
:
Stub
(
v
)
e
=
ctx
.
exc_value
self
.
assertTrue
(
isinstance
(
e
,
ExceptionMock
))
self
.
assertEqual
(
e
.
args
[
0
],
v
)
def
testSynonymAssertMethodNames
(
self
):
"""Test undocumented method name synonyms.
...
...
Lib/unittest/case.py
View file @
c730e424
...
...
@@ -116,7 +116,6 @@ class _AssertRaisesContext(object):
if
not
issubclass
(
exc_type
,
self
.
expected
):
# let unexpected exceptions pass through
return
False
self
.
exc_value
=
exc_value
#store for later retrieval
if
self
.
expected_regex
is
None
:
return
True
...
...
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