(self, handle_coverage=True)
runs all tests
runs all tests
runs all tests
def run_tests(self, handle_coverage=True):
        """ runs all tests """
        sys.stdout.write("Finding files... ")
        files = self.find_import_files()
        if self.verbosity > 3:
            sys.stdout.write('%s ... done.\n' % (self.files_or_dirs))
        else:
            sys.stdout.write('done.\n')
        sys.stdout.write("Importing test modules ... ")


        if handle_coverage:
            coverage_files, coverage = start_coverage_support(self.configuration)

        file_and_modules_and_module_name = self.find_modules_from_files(files)
        sys.stdout.write("done.\n")

        all_tests = self.find_tests_from_modules(file_and_modules_and_module_name)
        all_tests = self.filter_tests(all_tests)

        from _pydev_runfiles import pydev_runfiles_unittest
        test_suite = pydev_runfiles_unittest.PydevTestSuite(all_tests)
        from _pydev_runfiles import pydev_runfiles_xml_rpc
        pydev_runfiles_xml_rpc.notifyTestsCollected(test_suite.countTestCases())

        start_time = time.time()

        def run_tests():
            executed_in_parallel = False
            if self.jobs > 1:
                from _pydev_runfiles import pydev_runfiles_parallel

                #What may happen is that the number of jobs needed is lower than the number of jobs requested
                #(e.g.: 2 jobs were requested for running 1 test) -- in which case execute_tests_in_parallel will
                #return False and won't run any tests.
                executed_in_parallel = pydev_runfiles_parallel.execute_tests_in_parallel(
                    all_tests, self.jobs, self.split_jobs, self.verbosity, coverage_files, self.configuration.coverage_include)

            if not executed_in_parallel:
                #If in coverage, we don't need to pass anything here (coverage is already enabled for this execution).
                runner = pydev_runfiles_unittest.PydevTextTestRunner(stream=sys.stdout, descriptions=1, verbosity=self.verbosity)
                sys.stdout.write('\n')
                runner.run(test_suite)

        if self.configuration.django:
            get_django_test_suite_runner()(run_tests).run_tests([])
        else:
            run_tests()

        if handle_coverage:
            coverage.stop()
            coverage.save()

        total_time = 'Finished in: %.2f secs.' % (time.time() - start_time,)
        pydev_runfiles_xml_rpc.notifyTestRunFinished(total_time)
def run_tests ( self , handle_coverage = True ) : sys . stdout . write ( "Finding files... " ) files = self . find_import_files ( ) if self . verbosity > 3 : sys . stdout . write ( '%s ... done.\n' % ( self . files_or_dirs ) ) else : sys . stdout . write ( 'done.\n' ) sys . stdout . write ( "Importing test modules ... " ) if handle_coverage : coverage_files , coverage = start_coverage_support ( self . configuration ) file_and_modules_and_module_name = self . find_modules_from_files ( files ) sys . stdout . write ( "done.\n" ) all_tests = self . find_tests_from_modules ( file_and_modules_and_module_name ) all_tests = self . filter_tests ( all_tests ) from _pydev_runfiles import pydev_runfiles_unittest test_suite = pydev_runfiles_unittest . PydevTestSuite ( all_tests ) from _pydev_runfiles import pydev_runfiles_xml_rpc pydev_runfiles_xml_rpc . notifyTestsCollected ( test_suite . countTestCases ( ) ) start_time = time . time ( ) def run_tests ( ) : executed_in_parallel = False if self . jobs > 1 : from _pydev_runfiles import pydev_runfiles_parallel #What may happen is that the number of jobs needed is lower than the number of jobs requested #(e.g.: 2 jobs were requested for running 1 test) -- in which case execute_tests_in_parallel will #return False and won't run any tests. executed_in_parallel = pydev_runfiles_parallel . execute_tests_in_parallel ( all_tests , self . jobs , self . split_jobs , self . verbosity , coverage_files , self . configuration . coverage_include ) if not executed_in_parallel : #If in coverage, we don't need to pass anything here (coverage is already enabled for this execution). runner = pydev_runfiles_unittest . PydevTextTestRunner ( stream = sys . stdout , descriptions = 1 , verbosity = self . verbosity ) sys . stdout . write ( '\n' ) runner . run ( test_suite ) if self . configuration . django : get_django_test_suite_runner ( ) ( run_tests ) . run_tests ( [ ] ) else : run_tests ( ) if handle_coverage : coverage . stop ( ) coverage . save ( ) total_time = 'Finished in: %.2f secs.' % ( time . time ( ) - start_time , ) pydev_runfiles_xml_rpc . notifyTestRunFinished ( total_time )