-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
18 lines (13 loc) · 784 Bytes
/
conftest.py
File metadata and controls
18 lines (13 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def pytest_addoption(parser):
parser.addoption("--host", action="store", help="Darktrace instance URL")
parser.addoption("--public-token", action="store", help="Public API token")
parser.addoption("--private-token", action="store", help="Private API token")
parser.addoption("--no-verify", action="store_true", help="Disable SSL verification")
# Suppress InsecureRequestWarning globally for all tests
import warnings # noqa: E402
from urllib3.exceptions import InsecureRequestWarning # noqa: E402
def pytest_configure(config):
# Only suppress SSL warnings when --no-verify is passed
# Follow SDK's default of verify_ssl=True
if config.getoption("no_verify", default=False):
warnings.filterwarnings("ignore", category=InsecureRequestWarning)