changeset 575:92f9d136044f pytest2

MoinMoin.log.load_config() called before import of MoinMoin.app in conftest.py and level changed to ERROR in test_logging.conf
author pkumar <contactprashantat@gmail.com>
date Wed, 08 Jun 2011 17:55:13 +0530
parents b7105cee9db7
children a9a8d49bb4f1
files MoinMoin/conftest.py MoinMoin/test_logging.conf
diffstat 2 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/conftest.py	Wed Jun 08 07:33:28 2011 +0530
+++ b/MoinMoin/conftest.py	Wed Jun 08 17:55:13 2011 +0530
@@ -30,15 +30,18 @@
 
 import pytest
 import py
+import MoinMoin.log
+
+""" Logging for tests to avoid useless output like timing information on stderr on test failures
+"""
+Moindir = py.path.local(__file__).dirname
+config_file = Moindir + '/test_logging.conf'
+MoinMoin.log.load_config(config_file)
+
 from MoinMoin.app import create_app_ext, destroy_app, before_wiki, after_wiki
 from MoinMoin._tests import maketestwiki, wikiconfig
 from MoinMoin.storage.backends import create_simple_mapping
-import MoinMoin.log
 
-""" Logging for tests to avoid error messages(stderr) on test failures"""
-Moindir = py.path.local(__file__).dirname
-config_file = Moindir + '/test_logging.conf'
-MoinMoin.log.load_config(config_file)
 
 def init_test_app(given_config):
     namespace_mapping, router_index_uri = create_simple_mapping("memory:", given_config.content_acl)
--- a/MoinMoin/test_logging.conf	Wed Jun 08 07:33:28 2011 +0530
+++ b/MoinMoin/test_logging.conf	Wed Jun 08 17:55:13 2011 +0530
@@ -13,11 +13,12 @@
 
 [handler_stderr]
 class=StreamHandler
-level=NOTSET
+level=ERROR
 formatter=tests
 args=(sys.stderr, )
 
 [formatter_tests]
-format=None
+format=%(asctime)s %(levelname)s %(name)s:%(lineno)d %(message)s
 datefmt=
 class=logging.Formatter
+