Esempio n. 1
0
 def get_tests_for_suite(self, selected_suite_name):
     """Gets the test list for the suite"""
     test_list = []
     for test_instance in self.discover():
         for test_method in test_instance.runnable_test_methods():
             if not selected_suite_name or TestCase.in_suite(test_method, selected_suite_name):
                 test_list.append(test_method)
     return test_list
Esempio n. 2
0
 def get_tests_for_suite(self, selected_suite_name):
     """Gets the test list for the suite"""
     test_list = []
     for test_instance in self.discover():
         for test_method in test_instance.runnable_test_methods():
             if not selected_suite_name or TestCase.in_suite(test_method, selected_suite_name):
                 test_list.append(test_method)
     return test_list
Esempio n. 3
0
    def list_tests(self, selected_suite_name=None):
        """Lists all tests, optionally scoped to a single suite."""
        test_list = []
        for test_instance in self.discover():
            for test_method in test_instance.runnable_test_methods():
                if not selected_suite_name or TestCase.in_suite(test_method, selected_suite_name):
                    test_list.append(test_method)

        pp = pprint.PrettyPrinter(indent=2)
        print(pp.pformat([self.get_test_method_name(test) for test in test_list]))
Esempio n. 4
0
    def list_tests(self, selected_suite_name=None):
        """Lists all tests, optionally scoped to a single suite."""
        test_list = []
        for test_instance in self.discover():
            for test_method in test_instance.runnable_test_methods():
                if not selected_suite_name or TestCase.in_suite(
                        test_method, selected_suite_name):
                    test_list.append(test_method)

        pp = pprint.PrettyPrinter(indent=2)
        print(
            pp.pformat([self.get_test_method_name(test)
                        for test in test_list]))
Esempio n. 5
0
    def list_tests(self, selected_suite_name=None):
        """Lists all tests, optionally scoped to a single suite."""
        test_list = []
        for test_case_class in self.test_case_classes:
            test_instance = test_case_class(
                suites_include=self.suites_include,
                suites_exclude=self.suites_exclude,
                suites_require=self.suites_require)
            for test_method in test_instance.runnable_test_methods():
                if not selected_suite_name or TestCase.in_suite(test_method, selected_suite_name):
                    test_list.append(test_method)

        pp = pprint.PrettyPrinter(indent=2)
        print(pp.pformat([self.get_test_method_name(test) for test in test_list]))
Esempio n. 6
0
 def _append_relevant_results_and_log_relevant_failures(result):
     """Log the results of test methods."""
     if not test_case.is_fixture_method(result.test_method):
         if not test_case.method_excluded(result.test_method):
             self.logger.report_test_result(result)
         results.append(result)
     elif result.test_method._fixture_type == 'class_teardown' and (result.failure or result.error):
         # For a class_teardown failure, log the name too (since it wouldn't have 
         # already been logged by on_run_test_method).
         self.logger.report_test_name(result.test_method)
         self.logger.report_test_result(result)
         results.append(result)
     if not result.success and not TestCase.in_suite(result.test_method, 'expected-failure'):
         self.logger.failure(result)