summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2018-09-24 16:49:59 -0500
committerJason Madden <jamadden@gmail.com>2018-09-24 16:49:59 -0500
commit2c8ca887c6b52e46827dd3522622e2af274740ce (patch)
treed20059891daacdfff5490f7319c6122e3e42e1ae
parentdc3e9730da94ff5f2b9a100bd4ab52b5ae90fc4b (diff)
downloadzope-configuration-2c8ca887c6b52e46827dd3522622e2af274740ce.tar.gz
100% coverage for test_xmlconfig.py
-rw-r--r--src/zope/configuration/tests/test_xmlconfig.py32
1 files changed, 10 insertions, 22 deletions
diff --git a/src/zope/configuration/tests/test_xmlconfig.py b/src/zope/configuration/tests/test_xmlconfig.py
index 4c06721..1aee86e 100644
--- a/src/zope/configuration/tests/test_xmlconfig.py
+++ b/src/zope/configuration/tests/test_xmlconfig.py
@@ -62,13 +62,6 @@ class ZopeSAXParseExceptionTests(unittest.TestCase):
class ParserInfoTests(unittest.TestCase):
- _tempdir = None
-
- def tearDown(self):
- if self._tempdir is not None:
- import shutil
- shutil.rmtree(self._tempdir)
-
def _getTargetClass(self):
from zope.configuration.xmlconfig import ParserInfo
return ParserInfo
@@ -656,7 +649,7 @@ class Test_includeOverrides(unittest.TestCase):
# dummy action, path from "previous" include
context.includepath = (fqp,)
def _callable():
- pass
+ raise NotImplementedError
context.actions.append({'discriminator': None,
'callable': _callable,
})
@@ -1154,20 +1147,15 @@ class _Monkey(object):
class LoggerStub(object):
- def __init__(self):
- self.errors = []
- self.warnings = []
- self.infos = []
- self.debugs = []
-
- def error(self, msg, *args, **kwargs):
- self.errors.append((msg, args, kwargs))
+ debugs = errors = warnings = infos = ()
- def warning(self, msg, *args, **kwargs):
- self.warnings.append((msg, args, kwargs))
+ def __init__(self):
+ def make_append(lst):
+ return lambda msg, *args, **kwargs: lst.append((msg, args, kwargs))
- def info(self, msg, *args, **kwargs):
- self.infos.append((msg, args, kwargs))
+ for name in 'error', 'warning', 'info', 'debug':
+ lst = []
+ setattr(self, name + 's', lst)
- def debug(self, msg, *args, **kwargs):
- self.debugs.append((msg, args, kwargs))
+ func = make_append(lst)
+ setattr(self, name, func)