Example #1
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
Example #2
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()
Example #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
Example #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()