diff options
author | Jason Madden <jamadden@gmail.com> | 2018-09-24 16:37:13 -0500 |
---|---|---|
committer | Jason Madden <jamadden@gmail.com> | 2018-09-24 16:37:13 -0500 |
commit | 7a513bad5d17c208ed1226771f183e526b10b86a (patch) | |
tree | 074eb496b2a2aa2bf2941f2e20bb0b7e61bd94b9 | |
parent | 82eacf528df7293d52d19e981ace634204c5bbe1 (diff) | |
download | zope-configuration-7a513bad5d17c208ed1226771f183e526b10b86a.tar.gz |
100% cover for name.py
The tests were being skipped entirely because they weren't listed in the suite.
Also fix some broken pragmas.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | src/zope/configuration/config.py | 4 | ||||
-rw-r--r-- | src/zope/configuration/tests/test_name.py | 27 | ||||
-rw-r--r-- | src/zope/configuration/tests/test_xmlconfig.py | 2 |
4 files changed, 13 insertions, 21 deletions
@@ -16,3 +16,4 @@ src/coverage.xml bin develop-eggs eggs +htmlcov/ diff --git a/src/zope/configuration/config.py b/src/zope/configuration/config.py index 09871cf..487154e 100644 --- a/src/zope/configuration/config.py +++ b/src/zope/configuration/config.py @@ -376,7 +376,7 @@ class ConfigurationMachine(ConfigurationAdapterRegistry, ConfigurationContext): info = action['info'] try: callable(*args, **kw) - except (KeyboardInterrupt, SystemExit): #pragma NO COVER + except (KeyboardInterrupt, SystemExit): # pragma: no cover raise except: if testing: @@ -398,7 +398,7 @@ class ConfigurationExecutionError(ConfigurationError): def __init__(self, etype, evalue, info): self.etype, self.evalue, self.info = etype, evalue, info - def __str__(self): #pragma NO COVER + def __str__(self): # pragma: no cover return "%s: %s\n in:\n %s" % (self.etype, self.evalue, self.info) ############################################################################## diff --git a/src/zope/configuration/tests/test_name.py b/src/zope/configuration/tests/test_name.py index 9faa2cc..d41b2d7 100644 --- a/src/zope/configuration/tests/test_name.py +++ b/src/zope/configuration/tests/test_name.py @@ -49,21 +49,21 @@ class Test_resolve(unittest.TestCase): def test_class_in_module(self): from zope.configuration.tests.directives import Complex - self.assertTrue( - self._callFUT('zope.configuration.tests.directives.Complex') - is Complex) + self.assertIs( + self._callFUT('zope.configuration.tests.directives.Complex'), + Complex) def test_class_w_same_name_as_module(self): from zope.configuration.tests.samplepackage.NamedForClass \ import NamedForClass - self.assertTrue( + self.assertIs( self._callFUT( - 'zope.configuration.tests.samplepackage.NamedForClass+') - is NamedForClass) - self.assertTrue( + 'zope.configuration.tests.samplepackage.NamedForClass+'), + NamedForClass) + self.assertIs( self._callFUT( - 'zope.configuration.tests.samplepackage.NamedForClass.') - is NamedForClass) + 'zope.configuration.tests.samplepackage.NamedForClass.'), + NamedForClass) class Test_getNormalizedName(unittest.TestCase): @@ -126,12 +126,3 @@ class Test_path(unittest.TestCase): self.assertEqual( self._callFUT('configure.zcml', 'zope.configuration.tests'), os.path.join(os.path.dirname(__file__), 'configure.zcml')) - - - -def test_suite(): - return unittest.TestSuite(( - unittest.makeSuite(Test_resolve), - unittest.makeSuite(Test_resolve), - unittest.makeSuite(Test_path), - )) diff --git a/src/zope/configuration/tests/test_xmlconfig.py b/src/zope/configuration/tests/test_xmlconfig.py index 283aa86..4c06721 100644 --- a/src/zope/configuration/tests/test_xmlconfig.py +++ b/src/zope/configuration/tests/test_xmlconfig.py @@ -1148,7 +1148,7 @@ class _Monkey(object): for k in self.replacements: if k in self.orig: setattr(self.module, k, self.orig[k]) - else: #pragma NO COVERSGE + else: # pragma: no cover delattr(self.module, k) |