def setUpClass(cls):
template_path = []
template_uniq = set()
for member in cls.__mro__:
try:
path = member._rft_template_path
except AttributeError:
continue
if isinstance(path, basestring):
path = [path]
elif isinstance(path, collections.Sequence):
pass
else:
path = [path]
uniq_path = set(path) - template_uniq
template_uniq.update(uniq_path)
template_path.extend(x for x in path if x in uniq_path)
cls.env = environment.Environment(template_path, cls._rft_config_path)
cls.env.setupclass()
super(TestCaseMixin, cls).setUpClass()
评论列表
文章目录