示例#1
0
文件: _util.py 项目: Auzzy/personal
def TestClass_register(cls, class_suite):
    suite_name_list.add(class_suite)

    if type(cls) is ClassType or type(cls) is TypeType:
        tests = pop_class_tests(cls)
        before_cls,before,after,after_cls = pop_class_fixtures(cls)
        name = cls.__name__
        data = TestClassData(name,class_suite,before_cls,before,after,after_cls)
        data.extend(tests)
        data.finish()
        
        test_classes.append(data)

        return cls
示例#2
0
文件: _util.py 项目: Auzzy/personal
def finish_module(name=DEFAULT_SUITE):
    before_cls,before,after,after_cls = pop_class_fixtures(DEFAULT_SUITE)
    cls_data = TestClassData(DEFAULT_SUITE,DEFAULT_SUITE,before_cls,before,after,after_cls)
    if test_list:
        cls_data.extend(test_list)
    cls_data.finish()
    
    before_module,after_module = pop_module_fixtures(name)
    module_data = TestModuleData(name,before_module,after_module)
    if cls_data:
        module_data.append(cls_data)
    if test_classes:
        module_data.extend(test_classes)

    if module_data:
        test_modules.append(module_data)
    
    reset_module()
示例#3
0
def TestClass_register(cls, class_suite):
    suite_name_list.add(class_suite)

    if type(cls) is ClassType or type(cls) is TypeType:
        tests = pop_class_tests(cls)
        before_cls, before, after, after_cls = pop_class_fixtures(cls)
        name = cls.__name__
        data = TestClassData(name, class_suite, before_cls, before, after,
                             after_cls)
        data.extend(tests)
        data.finish()

        test_classes.append(data)

        return cls
示例#4
0
def finish_module(name=DEFAULT_SUITE):
    before_cls, before, after, after_cls = pop_class_fixtures(DEFAULT_SUITE)
    cls_data = TestClassData(DEFAULT_SUITE, DEFAULT_SUITE, before_cls, before,
                             after, after_cls)
    if test_list:
        cls_data.extend(test_list)
    cls_data.finish()

    before_module, after_module = pop_module_fixtures(name)
    module_data = TestModuleData(name, before_module, after_module)
    if cls_data:
        module_data.append(cls_data)
    if test_classes:
        module_data.extend(test_classes)

    if module_data:
        test_modules.append(module_data)

    reset_module()