Beispiel #1
0
    def test_no_tests_found(self):
        tester = Tester()
        errors = StringIO.StringIO()

        # Here we need to remove any existing log handlers so that they
        # don't log the messages webkitpy.test while we're testing it.
        root_logger = logging.getLogger()
        root_handlers = root_logger.handlers
        root_logger.handlers = []

        tester.stream = errors
        tester.finder.find_names = lambda args, skip_integration, run_all: []
        oc = OutputCapture()
        try:
            oc.capture_output()
            self.assertFalse(tester.run())
        finally:
            out, err, logs = oc.restore_output()
            root_logger.handlers = root_handlers

        self.assertTrue('No tests to run' in errors.getvalue())
        self.assertTrue('No tests to run' in logs)
Beispiel #2
0
    def test_no_tests_found(self):
        tester = Tester()
        errors = StringIO.StringIO()

        # Here we need to remove any existing log handlers so that they
        # don't log the messages webkitpy.test while we're testing it.
        root_logger = logging.getLogger()
        root_handlers = root_logger.handlers
        root_logger.handlers = []

        tester.stream = errors
        tester.finder.find_names = lambda args, skip_integration, run_all: []
        oc = OutputCapture()
        try:
            oc.capture_output()
            self.assertFalse(tester.run())
        finally:
            out, err, logs = oc.restore_output()
            root_logger.handlers = root_handlers

        self.assertTrue('No tests to run' in errors.getvalue())
        self.assertTrue('No tests to run' in logs)