From cbde1250488b7f11dcd3f3145a3c6bef2755235f Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 20 Sep 2010 10:03:38 +0000 Subject: [PATCH] Ignore certain lines for code coverage. svn path=/plone.app.discussion/trunk/; revision=40082 --- plone/app/discussion/patches.py | 2 +- plone/app/discussion/tool.py | 1 + plone/app/discussion/vocabularies.py | 29 ++++++++++++++-------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plone/app/discussion/patches.py b/plone/app/discussion/patches.py index 71aaca7..c9c08c2 100644 --- a/plone/app/discussion/patches.py +++ b/plone/app/discussion/patches.py @@ -34,7 +34,7 @@ def patchedClearFindAndRebuild(self): comment = comment.__of__(conversation) if catalog: catalog.indexObject(comment) - except StopIteration: + except StopIteration: # pragma: no cover pass except TypeError: diff --git a/plone/app/discussion/tool.py b/plone/app/discussion/tool.py index c12a8e9..68a064d 100644 --- a/plone/app/discussion/tool.py +++ b/plone/app/discussion/tool.py @@ -13,6 +13,7 @@ from interfaces import ICommentingTool, IComment from Products.CMFCore.utils import UniqueObject, getToolByName from OFS.SimpleItem import SimpleItem + class CommentingTool(UniqueObject, SimpleItem): interface.implements(ICommentingTool) diff --git a/plone/app/discussion/vocabularies.py b/plone/app/discussion/vocabularies.py index 293e5d5..ad86275 100644 --- a/plone/app/discussion/vocabularies.py +++ b/plone/app/discussion/vocabularies.py @@ -7,28 +7,28 @@ from plone.app.discussion.interfaces import _ HAS_CAPTCHA = False try: import plone.formwidget.captcha - HAS_CAPTCHA = True + HAS_CAPTCHA = True # pragma: no cover except ImportError: pass HAS_RECAPTCHA = False try: import plone.formwidget.recaptcha - HAS_RECAPTCHA = True + HAS_RECAPTCHA = True # pragma: no cover except ImportError: pass HAS_AKISMET = False try: import collective.akismet - HAS_AKISMET = True + HAS_AKISMET = True # pragma: no cover except ImportError: pass HAS_NOROBOTS = False try: import collective.z3cform.norobots - HAS_NOROBOTS = True + HAS_NOROBOTS = True # pragma: no cover except ImportError: pass @@ -43,36 +43,35 @@ def captcha_vocabulary(context): token='disabled', title=_(u'Disabled'))) - if HAS_CAPTCHA: + if HAS_CAPTCHA: # pragma: no cover terms.append( SimpleTerm( value='captcha', token='captcha', title='Captcha')) - if HAS_RECAPTCHA: + + if HAS_RECAPTCHA: # pragma: no cover terms.append( SimpleTerm( value='recaptcha', token='recaptcha', - title='ReCaptcha')) - if HAS_AKISMET: + title='ReCaptcha')) + + if HAS_AKISMET: # pragma: no cover terms.append( SimpleTerm( value='akismet', token='akismet', - title='Akismet')) - - - if HAS_NOROBOTS: - terms.append( + title='Akismet')) + + if HAS_NOROBOTS: # pragma: no cover + terms.append( SimpleTerm( value='norobots', token='norobots', title='Norobots')) - return SimpleVocabulary(terms) - def text_transform_vocabulary(context): """Vocabulary with all available portal_transform transformations. """