-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconftest.py
More file actions
35 lines (28 loc) · 993 Bytes
/
conftest.py
File metadata and controls
35 lines (28 loc) · 993 Bytes
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
import os
import sys
os.environ.setdefault("AWS_DEFAULT_REGION", "us-east-1")
os.environ.setdefault("AWS_REGION", "us-east-1")
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "scanner-lambda"))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "scripts"))
@pytest.fixture(autouse=True)
def aws_credentials(monkeypatch):
monkeypatch.setenv("AWS_ACCESS_KEY_ID", "testing")
monkeypatch.setenv("AWS_SECRET_ACCESS_KEY", "testing")
monkeypatch.setenv("AWS_SECURITY_TOKEN", "testing")
monkeypatch.setenv("AWS_SESSION_TOKEN", "testing")
monkeypatch.setenv("AWS_DEFAULT_REGION", "us-east-1")
@pytest.fixture
def reset_env(monkeypatch):
env_vars = [
"QUALYS_SECRET_ARN",
"SNS_TOPIC_ARN",
"RESULTS_S3_BUCKET",
"SCAN_CACHE_TABLE",
"ENABLE_TAGGING",
"SCAN_TIMEOUT",
"CACHE_TTL_DAYS",
]
for var in env_vars:
monkeypatch.delenv(var, raising=False)
return monkeypatch