def setup(self): self.options = parse_config_file() self.mapping_options = parse_mapping_file() self.es_client = setup_es_client(self.options) self.rabbitmq_alerts_consumer = setup_rabbitmq_client(self.options) current_date = datetime.now() self.event_index_name = current_date.strftime("events-%Y%m%d") self.previous_event_index_name = (current_date - timedelta(days=1)).strftime("events-%Y%m%d") self.alert_index_name = current_date.strftime("alerts-%Y%m") if pytest.config.option.delete_indexes: self.reset_elasticsearch() self.setup_elasticsearch() if pytest.config.option.delete_queues: self.reset_rabbitmq()