Exemplo n.º 1
0
 def run(self):
     if self.options.test_install_dir:
         install_dir = os.path.abspath(os.path.expanduser(self.options.test_install_dir))
         os.makedirs(install_dir)
     else:
         install_dir = tempfile.mkdtemp(suffix='-engage')
     try:
         (app_dir_path, undo_ops, python_exe) = \
             simulated_install(self.archive_file, install_dir,
                               self.django_settings_module,
                               package_cache_dir=self.options.package_cache_dir)
         return self._validate_and_prepare_dir(app_dir_path, undo_ops,
                                               python_exe)
     finally:
         if not self.options.test_install_dir:
             shutil.rmtree(install_dir)
Exemplo n.º 2
0
 def run(self):
     with create_handler(self.archive_file) as handler:
         (common_dir, django_config) = run_safe_validations(handler)
     if self.options.test_install_dir:
         install_dir = os.path.abspath(os.path.expanduser(self.options.test_install_dir))
         os.makedirs(install_dir)            
     else:
         install_dir = tempfile.mkdtemp(suffix="-engage")
     try:
         (app_dir_path, undo_ops, python_exe) = \
             simulated_install(self.archive_file, install_dir,
                               django_config.django_settings_module,
                               package_cache_dir=self.options.package_cache_dir)
         results = run_installed_tests_as_subprocess(app_dir_path,
                                                     django_config.django_settings_module,
                                                     python_exe_path=python_exe,
                                                     read_config_file=True)
         results.print_final_status_message(logger)
         return results.get_return_code()
     finally:
         if self.options.test_install_dir:
             shutil.rmtree(install_dir)