Former-commit-id:a02aeb236c
[formerly9f19e3f712
] [formerly06a8b51d6d
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]] Former-commit-id:06a8b51d6d
Former-commit-id:3360eb6c5f
24 lines
613 B
Python
Executable file
24 lines
613 B
Python
Executable file
import sys
|
|
import unittest
|
|
import warnings
|
|
from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
|
|
|
|
class TestErrorClassWithStringException(unittest.TestCase):
|
|
|
|
def test_string_exception_not_masked(self):
|
|
|
|
class X(Exception):
|
|
pass
|
|
|
|
class EP(ErrorClassPlugin):
|
|
xes = ErrorClass(X, label='XXX', isfailure=True)
|
|
|
|
warnings.filterwarnings(action='ignore', category=DeprecationWarning)
|
|
try:
|
|
|
|
raise "oh no!"
|
|
except:
|
|
exc = sys.exc_info()
|
|
|
|
ep = EP()
|
|
self.assertEqual(ep.addError(None, exc), None)
|