← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/launchpad/testfix into lp:launchpad/devel

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/launchpad/testfix into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code


= Testfix =

Urgent; blocking release-critical fixes.

Eliminates some 2.6-isms that snuck into devel somehow and were breaking the build.

To test:
{{{
./bin/test -vvc -t test_handlers -t test_questiontarget -t test_packagebuild -t test_sourcepackagerecipebuild -t test_binarypackagebuild -t test_hasbuildrecords -t test_publishing_models -t bugnotification -t notification-sending.txt -t propertycache.txt
}}}
-- 
https://code.launchpad.net/~jtv/launchpad/testfix/+merge/34663
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/launchpad/testfix into lp:launchpad/devel.
=== modified file 'lib/canonical/launchpad/mail/tests/test_handlers.py'
--- lib/canonical/launchpad/mail/tests/test_handlers.py	2010-08-27 13:38:13 +0000
+++ lib/canonical/launchpad/mail/tests/test_handlers.py	2010-09-06 09:17:43 +0000
@@ -1,6 +1,8 @@
 # Copyright 2009 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
+from __future__ import with_statement
+
 __metaclass__ = type
 
 from doctest import DocTestSuite

=== modified file 'lib/lp/answers/browser/tests/test_questiontarget.py'
--- lib/lp/answers/browser/tests/test_questiontarget.py	2010-08-26 17:45:46 +0000
+++ lib/lp/answers/browser/tests/test_questiontarget.py	2010-09-06 09:17:43 +0000
@@ -3,6 +3,8 @@
 
 """Test questiontarget views."""
 
+from __future__ import with_statement
+
 __metaclass__ = type
 
 import os

=== modified file 'lib/lp/bugs/scripts/bugnotification.py'
--- lib/lp/bugs/scripts/bugnotification.py	2010-08-23 09:25:17 +0000
+++ lib/lp/bugs/scripts/bugnotification.py	2010-09-06 09:17:43 +0000
@@ -13,10 +13,7 @@
     ]
 
 from itertools import groupby
-from operator import (
-    attrgetter,
-    itemgetter,
-    )
+from operator import itemgetter
 
 import transaction
 from zope.component import getUtility
@@ -196,10 +193,14 @@
         yield comment_count or 1, notification
 
 
+def get_bug_and_owner(notification):
+    """Retrieve `notification`'s `bug` and `message.owner` attributes."""
+    return notification.bug, notification.message.owner
+
+
 def notification_batches(notifications):
     """Batch notifications for `get_email_notifications`."""
-    notifications_grouped = groupby(
-        notifications, attrgetter("bug", "message.owner"))
+    notifications_grouped = groupby(notifications, get_bug_and_owner)
     for (bug, person), notification_group in notifications_grouped:
         batches = notification_comment_batches(notification_group)
         for comment_group, batch in groupby(batches, itemgetter(0)):

=== modified file 'lib/lp/buildmaster/tests/test_packagebuild.py'
--- lib/lp/buildmaster/tests/test_packagebuild.py	2010-08-30 13:58:15 +0000
+++ lib/lp/buildmaster/tests/test_packagebuild.py	2010-09-06 09:17:43 +0000
@@ -3,6 +3,8 @@
 
 """Tests for `IPackageBuild`."""
 
+from __future__ import with_statement
+
 __metaclass__ = type
 
 from datetime import datetime

=== modified file 'lib/lp/services/doc/propertycache.txt'
--- lib/lp/services/doc/propertycache.txt	2010-08-23 10:33:27 +0000
+++ lib/lp/services/doc/propertycache.txt	2010-09-06 09:17:43 +0000
@@ -16,7 +16,7 @@
     >>> class Foo:
     ...     @cachedproperty
     ...     def bar(self):
-    ...         return next(counter)
+    ...         return counter.next()
 
     >>> foo = Foo()