Exemplo n.º 1
0
    def handle(self, *test_labels, **options):
        # instantiate tasks
        self.tasks = [task_cls(test_labels, options) for task_cls in self.tasks_cls]

        # subscribe
        for signal_name, signal in inspect.getmembers(signals):            
            for task in self.tasks:
                signal_handler = getattr(task, signal_name, None)
                if signal_handler:
                    signal.connect(signal_handler)
        
        # run
		try:
			TestRunner = get_runner(settings)

			if not issubclass(TestRunner, CITestSuiteRunner):
				raise ValueError('Your custom TestRunner should extend the CITestSuiteRunner class.')

			test_runner = TestRunner(output_dir=options['output_dir'], interactive=False, debug=options['debug'])
		except:
			test_runner = CITestSuiteRunner(output_dir=options['output_dir'], interactive=False, debug=options['debug'])

		failures = test_runner.run_tests(test_labels)
        if failures:
            sys.exit(bool(failures))
Exemplo n.º 2
0
    def handle(self, *test_labels, **options):
        # instantiate tasks
        self.tasks = [task_cls(test_labels, options) for task_cls in self.tasks_cls]

        # subscribe
        for signal_name, signal in inspect.getmembers(signals):
            for task in self.tasks:
                signal_handler = getattr(task, signal_name, None)
                if signal_handler:
                    signal.connect(signal_handler)

        # run
        test_runner = CITestSuiteRunner(output_dir=options['output_dir'], interactive=False, debug=options['debug'])

        if test_runner.run_tests(test_labels):
            sys.exit(1)
Exemplo n.º 3
0
 def build_suite(self, test_labels, extra_tests=None, **kwargs):
     # args and kwargs saved in instance to use in the signal below
     self.test_labels = test_labels
     self.build_suite_kwargs = kwargs
     suite = CITestSuiteRunner.build_suite(self, test_labels, extra_tests, **kwargs)
     return suite
Exemplo n.º 4
0
 def build_suite(self, test_labels, **kwargs):
     # args and kwargs saved in instance to use in the signal below
     self.test_labels = test_labels
     self.build_suite_kwargs = kwargs
     suite = CITestSuiteRunner.build_suite(self, test_labels, **kwargs)
     return suite