Esempio n. 1
0
    def setUp(self):
        flags.reset()
        template_cache.clear()
        # disable capturing warnings
        logging.captureWarnings(False)
        self._clean_files()

        self.use_profile(self._pick_profile())
        self.use_default_project()
        self.set_packages()
        self.load_config()
Esempio n. 2
0
    def setUp(self):
        self._created_schemas = set()
        flags.reset()
        template_cache.clear()
        # disable capturing warnings
        logging.captureWarnings(False)
        self._clean_files()

        self.use_profile(self._pick_profile())
        self.use_default_project()
        self.set_packages()
        self.load_config()
Esempio n. 3
0
    def setUp(self):
        self.dbt_core_install_root = os.path.dirname(dbt.__file__)
        log_manager.reset_handlers()
        self.initial_dir = INITIAL_ROOT
        os.chdir(self.initial_dir)
        # before we go anywhere, collect the initial path info
        self._logs_dir = os.path.join(self.initial_dir, 'logs', self.prefix)
        _really_makedirs(self._logs_dir)
        self.test_original_source_path = _pytest_get_test_root()
        self.test_root_dir = self._generate_test_root_dir()

        os.chdir(self.test_root_dir)
        try:
            self._symlink_test_folders()
        except Exception as exc:
            msg = '\n\t'.join((
                'Failed to symlink test folders!',
                'initial_dir={0.initial_dir}',
                'test_original_source_path={0.test_original_source_path}',
                'test_root_dir={0.test_root_dir}'
            )).format(self)
            logger.exception(msg)

            # if logging isn't set up, I still really want this message.
            print(msg)
            traceback.print_exc()

            raise

        self._created_schemas = set()
        reset_deprecations()
        flags.reset()
        template_cache.clear()

        self.use_profile(self._pick_profile())
        self.use_default_project()
        self.set_packages()
        self.set_selectors()
        self.load_config()
Esempio n. 4
0
    def setUp(self):
        self.initial_dir = INITIAL_ROOT
        os.chdir(self.initial_dir)
        # before we go anywhere, collect the initial path info
        self._logs_dir = os.path.join(self.initial_dir, 'logs', self.prefix)
        print('initial_dir={}'.format(self.initial_dir))
        _really_makedirs(self._logs_dir)
        self.test_original_source_path = _pytest_get_test_root()
        print('test_original_source_path={}'.format(
            self.test_original_source_path))
        self.test_root_dir = tempfile.mkdtemp(prefix='dbt-int-test-')
        print('test_root_dir={}'.format(self.test_root_dir))
        os.chdir(self.test_root_dir)
        try:
            self._symlink_test_folders()
        except Exception as exc:
            msg = '\n\t'.join(
                ('Failed to symlink test folders!',
                 'initial_dir={0.initial_dir}',
                 'test_original_source_path={0.test_original_source_path}',
                 'test_root_dir={0.test_root_dir}')).format(self)
            logger.exception(msg)

            # if logging isn't set up, I still really want this message.
            print(msg)
            traceback.print_exc()

            raise

        self._created_schemas = set()
        flags.reset()
        template_cache.clear()
        # disable capturing warnings
        logging.captureWarnings(False)

        self.use_profile(self._pick_profile())
        self.use_default_project()
        self.set_packages()
        self.load_config()