← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:remove-more-class-advice into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:remove-more-class-advice into launchpad:master.

Commit message:
Fix a couple of class advice stragglers in doctests

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/380388

The example in conversation.txt is just a textual example rather than something that's tested, but we might as well update it anyway.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:remove-more-class-advice into launchpad:master.
diff --git a/lib/lp/app/browser/tests/test_launchpadform_doc.py b/lib/lp/app/browser/tests/test_launchpadform_doc.py
index 7b2074d..caafbcb 100644
--- a/lib/lp/app/browser/tests/test_launchpadform_doc.py
+++ b/lib/lp/app/browser/tests/test_launchpadform_doc.py
@@ -100,14 +100,14 @@ def doctest_custom_widget_with_setUpFields_override():
     consider this custom widget and view:
 
         >>> from zope.formlib.interfaces import IDisplayWidget, IInputWidget
-        >>> from zope.interface import directlyProvides, implements
+        >>> from zope.interface import implementer
         >>> from lp.app.browser.launchpadform import LaunchpadFormView
         >>> from zope.schema import Bool
         >>> from zope.publisher.browser import TestRequest
         >>> from zope.formlib import form
 
-        >>> class CustomStubWidget:
-        ...     implements(IInputWidget)
+        >>> @implementer(IInputWidget)
+        ... class CustomStubWidget:
         ...     # The methods below are the minimal necessary for widget
         ...     # initialization.
         ...     def __init__(self, field, request):
diff --git a/lib/lp/services/comments/doc/conversation.txt b/lib/lp/services/comments/doc/conversation.txt
index 033e9a1..6198e44 100644
--- a/lib/lp/services/comments/doc/conversation.txt
+++ b/lib/lp/services/comments/doc/conversation.txt
@@ -18,13 +18,11 @@ The comment in the conversation needs to provide the IComment interface.  A
 simple way to do this is to have a view class that implements IComment and
 delegates to the underlying interface object, like this:
 
+@implementer(IComment)
+@delegate_to(ICodeReviewComment, context='comment')
 class CodeReviewDisplayComment:
     """A code review comment or activity or both."""
 
-    implements(IComment)
-
-    delegates(ICodeReviewComment, 'comment')
-
     ...