-
Notifications
You must be signed in to change notification settings - Fork 46
/
conftest.py
42 lines (37 loc) · 954 Bytes
/
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
37
38
39
40
41
42
import sys
import os.path
import logging
from pytest import fixture
sys.path.insert(0, os.path.dirname(__file__))
try:
import colorlog
handler = colorlog.StreamHandler()
formatter = colorlog.ColoredFormatter(
"%(log_color)s%(levelname)-8s%(reset)s %(name)-32s %(message)s",
datefmt=None,
reset=True,
log_colors={
'DEBUG': 'cyan',
'INFO': 'green',
'WARNING': 'yellow',
'ERROR': 'red',
'CRITICAL': 'red,bg_white',
},
secondary_log_colors={},
style='%',
)
handler.setFormatter(formatter)
logger = colorlog.getLogger()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
except ImportError:
logging.basicConfig(
level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(name)s - %(message)s')
if os.name == 'nt':
collect_ignore = ['quamash/_unix.py']
else:
collect_ignore = ['quamash/_windows.py']
@fixture(scope='session')
def application():
from quamash import QApplication
return QApplication([])