Пример #1
0
    def build_suite(self, suite, **kwargs):
        paths = harvest_lettuces(self.test_labels)
        for app_path, app_module in paths:
            runner = Runner(app_path,
                            enable_xunit=True,
                            xunit_filename=path.join(self.output_dir, 'lettuce.xml'))

            suite.addTest(LettuceTestCase(runner, app_module))

        return suite
Пример #2
0
def feature_index(request):
    '''Render the list of lettuce features.'''
    f_list = []
    for path in harvest_lettuces():
        if isinstance(path, tuple) and len(path) is 2:
            path, app_module = path
            feature_files = fs.FeatureLoader(path).find_feature_files()
            f_list.extend([Feature.from_file(f) for f in feature_files])
    return render_to_response('feature_index.html', {'features': f_list}, 
        context_instance=RequestContext(request))
Пример #3
0
    def get_paths(self, args, apps_to_run, apps_to_avoid):
        if args:
            for path, exists in zip(args, map(os.path.exists, args)):
                if not exists:
                    sys.stderr.write("You passed the path '%s', but it does not exist.\n" % path)
                    sys.exit(1)
            else:
                paths = args
        else:
            paths = harvest_lettuces(apps_to_run, apps_to_avoid)  # list of tuples with (path, app_module)

        return paths
Пример #4
0
    def get_paths(self, args, apps_to_run, apps_to_avoid):
        if args:
            for path, exists in zip(args, map(os.path.exists, args)):
                if not exists:
                    sys.stderr.write("You passed the path '%s', but it does not exist.\n" % path)
                    sys.exit(1)
            else:
                paths = args
        else:
            paths = harvest_lettuces(apps_to_run, apps_to_avoid)  # list of tuples with (path, app_module)

        return paths
Пример #5
0
    def handle_noargs(self, **options):
        settings.DEBUG = False
        setup_test_environment()

        verbosity = int(options.get('verbosity', 4))

        server.start()

        failed = False
        try:
            for path in harvest_lettuces():
                registry.clear()
                result = Runner(path, verbosity).run()

                if not result or result.steps != result.steps_passed:
                    failed = True

        except Exception, e:
            import traceback
            traceback.print_exc(e)