File: conftest.py

package info (click to toggle)
python-quamash 0.6.1~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 204 kB
  • sloc: python: 1,290; sh: 4; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (2)
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([])