-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
43 lines (42 loc) · 1.06 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import chalice
import unittest
import datetime
import json
import os
import sys
import time
import boto3
import app
from foursight_core import (
fs_connection,
s3_connection,
es_connection,
exceptions,
check_schema,
stage,
environment,
sqs_utils,
run_result,
check_utils,
decorators,
)
from chalicelib_fourfront import (
app_utils,
)
from chalicelib_fourfront.vars import *
from chalicelib_fourfront import __file__ as chalicelib_path
from chalicelib_fourfront.checks.helpers.confchecks import *
from dcicutils import s3_utils, ff_utils
from contextlib import contextmanager
import pytest
@pytest.fixture(scope='session', autouse=True)
def setup():
app.set_stage('test') # set the stage info for tests
test_client = boto3.client('sqs') # purge test queue
queue_url = sqs_utils.SQS(FOURSIGHT_PREFIX).get_sqs_queue().url
try:
test_client.purge_queue(
QueueUrl=queue_url
)
except test_client.exceptions.PurgeQueueInProgress:
print('Cannot purge test queue; purge already in progress')