-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
16 lines (13 loc) · 753 Bytes
/
conftest.py
File metadata and controls
16 lines (13 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
from urllib3.exceptions import InsecureRequestWarning
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)