Browse Source

Enable logging in tests (fixes #21)

* add logging.config.fileConfig in gnuviechadmin/tests/__init__.py
 * provide default logging configuration in test.ini


git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/trunk@259 a67ec6bc-e5d5-0310-a910-815c51eb3124
master
Jan Dittberner 12 years ago
parent
commit
b183465d5e
2 changed files with 31 additions and 0 deletions
  1. +2
    -0
      gnuviechadmin/tests/__init__.py
  2. +29
    -0
      test.ini

+ 2
- 0
gnuviechadmin/tests/__init__.py View File

@@ -29,6 +29,7 @@ setuptools.
"""
import os
import sys
import logging.config
from unittest import TestCase

import pkg_resources
@@ -40,3 +41,4 @@ sys.path.insert(0, conf_dir)
pkg_resources.working_set.add_entry(conf_dir)

test_file = os.path.join(conf_dir, 'test.ini')
logging.config.fileConfig(test_file)

+ 29
- 0
test.ini View File

@@ -0,0 +1,29 @@
# Logging configuration
[loggers]
keys = root, gnuviechadmin

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_gnuviechadmin]
level = DEBUG
handlers = console
propagate = 0
qualname = gnuviechadmin

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S

Loading…
Cancel
Save