Exemple #1
0
    def handle(self, *test_labels, **options):
        

        from impatient_test.find_all_tests import get_all_TestDescriptions
        from impatient_test.distributor import run_tests_parallel, summarize_results
        from impatient_test.filters import culled_apps, construct_envs
        from django.conf import settings
        import pdb
        print options
        #

        all_tds = []
        for app in culled_apps():
            all_tds.extend(get_all_TestDescriptions(app))
        #1/0



        env_tds = construct_envs(all_tds)
        #summarize_results(run_tests_parallel(all_tds[0:5]))
        #pdb.set_trace()
        
        max_tests = int(options.get("max_tests", False) or len(env_tds))
        test_results = run_tests_parallel(env_tds[0:max_tests])
        summarize_results(
            test_results,
            verbose=options.get('show_all_output',False)
            )
    def test_mysql_passthrough(self):
        # self.assert
        from output_fixture.tests import stdout_string, stderr_string

        env_mysql = os.environ.get("PPY_MYSQL", False)
        self.assertEquals(env_mysql, False)
        td = make_td("env_check.EnvCheckClass.test_mysql_env")
        td.env = {"PPY_MYSQL": "True"}

        [tr] = distributor.run_tests_parallel([td])
        self.assertEquals(tr.return_code, 0)
        # we want to make sure that we aren't dirtying the
        # environment, since this runs with the multiprocessing module
        # in a subprocess, that shouldn't be an issue
        env_mysql = os.environ.get("PPY_MYSQL", False)
        self.assertEquals(env_mysql, False)