-
Notifications
You must be signed in to change notification settings - Fork 40
/
conftest.py
36 lines (27 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
import logging
import pytest
@pytest.hookimpl
def pytest_addoption(parser):
parser.addoption('--app', action='store', default="ios", help="Choose App: ios or android")
parser.addoption('--device', action='store', default="emulator", help="Choose Device: simulator / emulator / real "
"device")
@pytest.fixture(scope="session")
def app(request):
return request.config.getoption("--app")
@pytest.fixture(scope="session")
def device(request):
return request.config.getoption("--device")
@pytest.fixture(scope='session')
def get_logger():
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
ch = logging.FileHandler(r'app.log', mode='w')
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(levelname)s: %(message)s', '%m/%d/%Y %I:%M:%S %p')
ch.setFormatter(formatter)
logger.addHandler(ch)
return logger
# @pytest.fixture(scope='session', autouse=True)
# def session_setup_teardown():
# yield
# notify_slack()