Show More
@@ -158,7 +158,7 b' def imported_from_test():' | |||||
158 | def assert_raises(func, exc_type, str_contains=None, repr_contains=None): |
|
158 | def assert_raises(func, exc_type, str_contains=None, repr_contains=None): | |
159 | try: |
|
159 | try: | |
160 | func() |
|
160 | func() | |
161 |
except exc_type |
|
161 | except exc_type, e: | |
162 | if str_contains is not None and str_contains not in str(e): |
|
162 | if str_contains is not None and str_contains not in str(e): | |
163 | raise AssertionError("%s raised, but %r does not contain %r" |
|
163 | raise AssertionError("%s raised, but %r does not contain %r" | |
164 | % (exc_type, str(e), str_contains)) |
|
164 | % (exc_type, str(e), str_contains)) |
General Comments 0
You need to be logged in to leave comments.
Login now