Test that an exception is raised when callable is called with any
positional or keyword arguments that are also passed to
assertRaises(). The test passes if exception is raised, is an error if
another exception is raised, or fails if no exception is raised. To
catch any of a group of exceptions, a tuple containing the exception
classes may be passed as exception.
直接从docs开始:
所以,你的代码应该看起来像
相关问题 更多 >
编程相关推荐