Merge lp:~jtv/launchpad/testfix into lp:launchpad

Proposed by Jeroen T. Vermeulen on 2010-09-06
Status: Merged
Approved by: Graham Binns on 2010-09-06
Approved revision: no longer in the source branch.
Merged at revision: 11512
Proposed branch: lp:~jtv/launchpad/testfix
Merge into: lp:launchpad
Diff against target: 83 lines (+14/-7)
5 files modified
lib/canonical/launchpad/mail/tests/test_handlers.py (+2/-0)
lib/lp/answers/browser/tests/test_questiontarget.py (+2/-0)
lib/lp/bugs/scripts/bugnotification.py (+7/-6)
lib/lp/buildmaster/tests/test_packagebuild.py (+2/-0)
lib/lp/services/doc/propertycache.txt (+1/-1)
To merge this branch: bzr merge lp:~jtv/launchpad/testfix
Reviewer Review Type Date Requested Status
Graham Binns (community) release-critical Approve on 2010-09-06
Henning Eggers (community) code 2010-09-06 Approve on 2010-09-06
Review via email: mp+34663@code.launchpad.net

Commit message

Fix 2.6-isms that broke the devel build.

Description of the change

= 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
}}}

To post a comment you must log in.
Henning Eggers (henninge) :
review: Approve (code)
Graham Binns (gmb) :
review: Approve (release\)
Graham Binns (gmb) wrote :

Hah.

review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/mail/tests/test_handlers.py'
2--- lib/canonical/launchpad/mail/tests/test_handlers.py 2010-08-27 13:38:13 +0000
3+++ lib/canonical/launchpad/mail/tests/test_handlers.py 2010-09-06 09:17:56 +0000
4@@ -1,6 +1,8 @@
5 # Copyright 2009 Canonical Ltd. This software is licensed under the
6 # GNU Affero General Public License version 3 (see the file LICENSE).
7
8+from __future__ import with_statement
9+
10 __metaclass__ = type
11
12 from doctest import DocTestSuite
13
14=== modified file 'lib/lp/answers/browser/tests/test_questiontarget.py'
15--- lib/lp/answers/browser/tests/test_questiontarget.py 2010-08-26 17:45:46 +0000
16+++ lib/lp/answers/browser/tests/test_questiontarget.py 2010-09-06 09:17:56 +0000
17@@ -3,6 +3,8 @@
18
19 """Test questiontarget views."""
20
21+from __future__ import with_statement
22+
23 __metaclass__ = type
24
25 import os
26
27=== modified file 'lib/lp/bugs/scripts/bugnotification.py'
28--- lib/lp/bugs/scripts/bugnotification.py 2010-08-23 09:25:17 +0000
29+++ lib/lp/bugs/scripts/bugnotification.py 2010-09-06 09:17:56 +0000
30@@ -13,10 +13,7 @@
31 ]
32
33 from itertools import groupby
34-from operator import (
35- attrgetter,
36- itemgetter,
37- )
38+from operator import itemgetter
39
40 import transaction
41 from zope.component import getUtility
42@@ -196,10 +193,14 @@
43 yield comment_count or 1, notification
44
45
46+def get_bug_and_owner(notification):
47+ """Retrieve `notification`'s `bug` and `message.owner` attributes."""
48+ return notification.bug, notification.message.owner
49+
50+
51 def notification_batches(notifications):
52 """Batch notifications for `get_email_notifications`."""
53- notifications_grouped = groupby(
54- notifications, attrgetter("bug", "message.owner"))
55+ notifications_grouped = groupby(notifications, get_bug_and_owner)
56 for (bug, person), notification_group in notifications_grouped:
57 batches = notification_comment_batches(notification_group)
58 for comment_group, batch in groupby(batches, itemgetter(0)):
59
60=== modified file 'lib/lp/buildmaster/tests/test_packagebuild.py'
61--- lib/lp/buildmaster/tests/test_packagebuild.py 2010-08-30 13:58:15 +0000
62+++ lib/lp/buildmaster/tests/test_packagebuild.py 2010-09-06 09:17:56 +0000
63@@ -3,6 +3,8 @@
64
65 """Tests for `IPackageBuild`."""
66
67+from __future__ import with_statement
68+
69 __metaclass__ = type
70
71 from datetime import datetime
72
73=== modified file 'lib/lp/services/doc/propertycache.txt'
74--- lib/lp/services/doc/propertycache.txt 2010-08-23 10:33:27 +0000
75+++ lib/lp/services/doc/propertycache.txt 2010-09-06 09:17:56 +0000
76@@ -16,7 +16,7 @@
77 >>> class Foo:
78 ... @cachedproperty
79 ... def bar(self):
80- ... return next(counter)
81+ ... return counter.next()
82
83 >>> foo = Foo()
84