def setUp(self):
    super().setUp()
    self.run_path = tempfile.mkdtemp()
    self.run_outputs_path = tempfile.mkdtemp()
    settings.CLIENT_CONFIG.is_managed = False
    os.environ[POLYAXON_KEYS_COLLECT_ARTIFACTS] = 'false'
    os.environ[POLYAXON_KEYS_COLLECT_RESOURCES] = 'false'
    with patch('polyaxon.tracking.run.Run._set_exit_handler') as exit_mock:
        self.run = Run(project='owner.project', track_env=False, track_code=False, auto_create=False)
    assert (exit_mock.call_count == 1)
    self.event_logger = EventFileWriter(run_path=self.run_path)
    self.resource_logger = ResourceFileWriter(run_path=self.run_path)
    self.run._artifacts_path = self.run_path
    self.run._outputs_path = self.run_outputs_path
    self.run._event_logger = self.event_logger
    self.run._resource_logger = self.resource_logger
    assert (os.path.exists(get_event_path(self.run_path)) is True)
    assert (os.path.exists(get_asset_path(self.run_path)) is True)
def setUp(self):
    super().setUp()
    self.run_path = tempfile.mkdtemp()
    self.run_outputs_path = tempfile.mkdtemp()
    settings.CLIENT_CONFIG.is_managed = False
    os.environ[POLYAXON_KEYS_COLLECT_ARTIFACTS] = 'false'
    os.environ[POLYAXON_KEYS_COLLECT_RESOURCES] = 'false'
    with patch('polyaxon.tracking.run.Run._set_exit_handler') as exit_mock:
        self.run = Run(project='owner.project', track_env=False, track_code=False, auto_create=False)
    assert (exit_mock.call_count == 1)
    self.event_logger = EventFileWriter(run_path=self.run_path)
    self.resource_logger = ResourceFileWriter(run_path=self.run_path)
    self.run._artifacts_path = self.run_path
    self.run._outputs_path = self.run_outputs_path
    self.run._event_logger = self.event_logger
    self.run._resource_logger = self.resource_logger
    assert (os.path.exists(get_event_path(self.run_path)) is True)
    assert (os.path.exists(get_asset_path(self.run_path)) is True)