Commit 2f7c4bce authored by Fred Drake's avatar Fred Drake

- only load the configuration schema once

- minor cleanups
parent 2a6367ef
...@@ -15,15 +15,16 @@ ...@@ -15,15 +15,16 @@
import os import os
import cStringIO import cStringIO
import logging
import tempfile import tempfile
import unittest import unittest
import ZConfig import ZConfig
import Zope.Startup import Zope.Startup
from Zope.Startup import ZopeStarter
from App.config import getConfiguration from App.config import getConfiguration
import logging from Zope.Startup import ZopeStarter
TEMPNAME = tempfile.mktemp() TEMPNAME = tempfile.mktemp()
TEMPPRODUCTS = os.path.join(TEMPNAME, "Products") TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
...@@ -39,15 +40,18 @@ def getSchema(): ...@@ -39,15 +40,18 @@ def getSchema():
logger_states = {} logger_states = {}
for name in ('event', 'trace', 'access'): for name in ('event', 'trace', 'access'):
logger = logging.getLogger(name) logger = logging.getLogger(name)
logger_states[name] = {'level':logger.level, logger_states[name] = {'level': logger.level,
'propagate':logger.propagate, 'propagate': logger.propagate,
'handlers':logger.handlers, 'handlers': logger.handlers,
'filters':logger.filters} 'filters': logger.filters}
class ZopeStarterTestCase(unittest.TestCase): class ZopeStarterTestCase(unittest.TestCase):
schema = None
def setUp(self): def setUp(self):
self.schema = getSchema() if self.schema is None:
ZopeStarterTestCase.schema = getSchema()
self.original_event_logger = logging.getLogger self.original_event_logger = logging.getLogger
def tearDown(self): def tearDown(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment