Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
bcae62c6
Commit
bcae62c6
authored
Sep 27, 2017
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue #20: TestCase subclass with a nicer assertRaises
parent
112f76fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
tests/testlib.py
tests/testlib.py
+13
-0
No files found.
tests/testlib.py
View file @
bcae62c6
...
...
@@ -28,6 +28,19 @@ def data_path(suffix):
return
path
class
TestCase
(
unittest
.
TestCase
):
def
assertRaises
(
self
,
exc
,
func
,
*
args
,
**
kwargs
):
"""Like regular assertRaises, except return the exception that was
raised. Can't use context manager because tests must run on Python2.4"""
try
:
func
(
*
args
,
**
kwargs
)
except
exc
,
e
:
return
e
except
BaseException
,
e
:
assert
0
,
'%r raised %r, not %r'
%
(
func
,
e
,
exc
)
assert
0
,
'%r did not raise %r'
%
(
func
,
exc
)
class
DockerizedSshDaemon
(
object
):
def
__init__
(
self
):
self
.
docker
=
docker
.
from_env
()
...
...
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