logging config: use new scopes.tests. util
This commit is contained in:
parent
9cc721f6cf
commit
ac75686e57
2 changed files with 3 additions and 8 deletions
|
@ -9,14 +9,6 @@ log_level = logging.INFO
|
||||||
log_format = '%(asctime)s %(levelname)s %(name)s %(message)s'
|
log_format = '%(asctime)s %(levelname)s %(name)s %(message)s'
|
||||||
log_dateformat = '%Y-%m-%dT%H:%M:%S'
|
log_dateformat = '%Y-%m-%dT%H:%M:%S'
|
||||||
|
|
||||||
def setup_logging():
|
|
||||||
hdlr = logging.getLogger().handlers[-1]
|
|
||||||
logging.getLogger().removeHandler(hdlr) # remove NullHandler added by testrunner
|
|
||||||
logging.basicConfig(filename=log_file, level=log_level,
|
|
||||||
format=log_format, datefmt=log_dateformat)
|
|
||||||
|
|
||||||
setup_logging()
|
|
||||||
|
|
||||||
# SQLite
|
# SQLite
|
||||||
dbengine = 'sqlite'
|
dbengine = 'sqlite'
|
||||||
dbname = 'scopes/office/tests/var/test.db'
|
dbname = 'scopes/office/tests/var/test.db'
|
||||||
|
|
|
@ -7,8 +7,11 @@ sys.path = [os.path.dirname(__file__)] + sys.path
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
from scopes.tests.util import setup_logging
|
||||||
from scopes.storage.common import StorageFactory
|
from scopes.storage.common import StorageFactory
|
||||||
import config
|
import config
|
||||||
|
|
||||||
|
setup_logging(config)
|
||||||
config.storageFactory = StorageFactory(config)
|
config.storageFactory = StorageFactory(config)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue