Merge ~cjwatson/launchpad:py3-services-identity-future-imports into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 4f71e5936744e31ee41fcbca04d8c247cd6d125f
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-services-identity-future-imports
Merge into: launchpad:master
Diff against target: 90 lines (+13/-10)
3 files modified
lib/lp/services/identity/doc/account.txt (+8/-8)
lib/lp/services/identity/doc/emailaddress.txt (+1/-1)
lib/lp/services/identity/tests/test_doc.py (+4/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+398381@code.launchpad.net

Commit message

Convert lp.services.identity doctests to __future__ imports

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Self-approving (mechanical and obvious).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/services/identity/doc/account.txt b/lib/lp/services/identity/doc/account.txt
2index f12fd42..9c2f82f 100644
3--- a/lib/lp/services/identity/doc/account.txt
4+++ b/lib/lp/services/identity/doc/account.txt
5@@ -51,7 +51,7 @@ look up the user.
6 >>> account = account_set.getByOpenIDIdentifier(u'no-priv_oid')
7 >>> IAccount.providedBy(account)
8 True
9- >>> print account.displayname
10+ >>> print(account.displayname)
11 No Privileges Person
12
13 A LookupError is raised if the identifier is not used by any account.
14@@ -75,7 +75,7 @@ accessible for the owner.
15
16 An account has a displayname.
17
18- >>> print account.displayname
19+ >>> print(account.displayname)
20 No Privileges Person
21
22 Account objects have a useful string representation.
23@@ -88,20 +88,20 @@ The account has other metadata.
24 >>> account.date_created
25 datetime.datetime(...)
26
27- >>> print account.creation_rationale.name
28+ >>> print(account.creation_rationale.name)
29 OWNER_CREATED_LAUNCHPAD
30
31- >>> print account.status.name
32+ >>> print(account.status.name)
33 ACTIVE
34
35 >>> account.date_status_set >= account.date_created
36 True
37
38 >>> from zope.security.proxy import removeSecurityProxy
39- >>> print removeSecurityProxy(account).status_history
40+ >>> print(removeSecurityProxy(account).status_history)
41 None
42
43- >>> print account.displayname
44+ >>> print(account.displayname)
45 No Privileges Person
46
47 When the status is changed, the date_status_set is updated in the
48@@ -142,7 +142,7 @@ rationale and displayname are required.
49 >>> new_account = account_set.new(
50 ... AccountCreationRationale.USER_CREATED, 'New Account')
51 >>> transaction.commit()
52- >>> print new_account.creation_rationale.name
53+ >>> print(new_account.creation_rationale.name)
54 USER_CREATED
55- >>> print new_account.displayname
56+ >>> print(new_account.displayname)
57 New Account
58diff --git a/lib/lp/services/identity/doc/emailaddress.txt b/lib/lp/services/identity/doc/emailaddress.txt
59index 607250b..4163d8f 100644
60--- a/lib/lp/services/identity/doc/emailaddress.txt
61+++ b/lib/lp/services/identity/doc/emailaddress.txt
62@@ -89,7 +89,7 @@ or the address of a team's mailing list.
63 >>> ignored = login_person(foobar)
64 >>> emailaddress = emailset.getByEmail('oink@canonical.com')
65 >>> emailaddress.destroySelf()
66- >>> print emailset.getByEmail('oink@canonical.com')
67+ >>> print(emailset.getByEmail('oink@canonical.com'))
68 None
69
70 Otherwise, UndeletableEmailAddress is raised.
71diff --git a/lib/lp/services/identity/tests/test_doc.py b/lib/lp/services/identity/tests/test_doc.py
72index b6e4289..621c854 100644
73--- a/lib/lp/services/identity/tests/test_doc.py
74+++ b/lib/lp/services/identity/tests/test_doc.py
75@@ -9,11 +9,14 @@ import os
76
77 from lp.services.testing import build_test_suite
78 from lp.testing.layers import DatabaseFunctionalLayer
79+from lp.testing.systemdocs import setUp
80
81
82 here = os.path.dirname(os.path.realpath(__file__))
83
84
85 def test_suite():
86- suite = build_test_suite(here, layer=DatabaseFunctionalLayer)
87+ suite = build_test_suite(
88+ here, layer=DatabaseFunctionalLayer,
89+ setUp=lambda test: setUp(test, future=True))
90 return suite

Subscribers

People subscribed via source and target branches

to status/vote changes: