def __init__(self, methodName):
# Pass the method name unmodified to the base class; this ensures that
# when run in Eclipse's PyDev, the implementation shows up next to the
# test name. This also means that __getattr__ must be overridden to
# find the original method.
unittest.TestCase.__init__(self, methodName)
# Save the implementation so that it is available in setUp().
# NOTE: Using type() ensures that the correct class object is queried,
# so the implementation list is correct--a static call via RHTestCase
# always returns an un-mangled name.
name, impl = type(self).splitImpl(methodName)
if not impl:
# This should only occur with a single implementation, where name
# mangling is disabled.
self.impl = self.__impls__[0]
else:
self.impl = impl
评论列表
文章目录