⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testbase.py

📁 antlr最新版本V3源代码
💻 PY
字号:
import unittestclass BrokenTest(unittest.TestCase.failureException):    def __repr__(self):        name, reason = self.args        return '%s: %s: %s works now' % (            (self.__class__.__name__, name, reason))def broken(reason, *exceptions):    '''Indicates a failing (or erroneous) test case fails that should succeed.    If the test fails with an exception, list the exception type in args'''    def wrapper(test_method):        def replacement(*args, **kwargs):            try:                test_method(*args, **kwargs)            except exceptions or unittest.TestCase.failureException:                pass            else:                raise BrokenTest(test_method.__name__, reason)        replacement.__doc__ = test_method.__doc__        replacement.__name__ = 'XXX_' + test_method.__name__        replacement.todo = reason        return replacement    return wrapper

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -