-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
22 lines (17 loc) · 768 Bytes
/
conftest.py
File metadata and controls
22 lines (17 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# conftest.py
from pytest_dependency import DependencyManager
import logging, os
DependencyManager.ScopeCls['module'] = DependencyManager.ScopeCls['session']
option = None
def pytest_addoption(parser):
"""Add the skippytestconfigure"""
parser.addoption( '-U', '--skippytestconfigure', action = "store", default = False, help = "Skip pytest_configure ?")
def pytest_configure(config):
skippytestconfigure = config.option
# set the log format
LOG_FORMAT = "%(levelname)s %(asctime)s - %(message)s \n---"
# configure the logger
logging.basicConfig(filename = os.getcwd() + "/reports/pytest.log", filemode = 'w',
level = logging.NOTSET,
format = LOG_FORMAT)
logger = logging.getLogger()