← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/blueprints-doctests-future-imports into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/blueprints-doctests-future-imports into lp:launchpad.

Commit message:
Convert doctests under lp.blueprints to Launchpad's preferred __future__ imports.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/blueprints-doctests-future-imports/+merge/347317
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/blueprints-doctests-future-imports into lp:launchpad.
=== modified file 'lib/lp/blueprints/doc/specgraph.txt'
--- lib/lp/blueprints/doc/specgraph.txt	2013-01-25 03:30:08 +0000
+++ lib/lp/blueprints/doc/specgraph.txt	2018-06-02 00:34:13 +0000
@@ -43,13 +43,13 @@
     >>> foo = Spec('foo', title='something with " and \n in it')
     >>> root = g.newNode(foo, root=True)
 
-    >>> print root
+    >>> print(root)
     <fnord-foo>
 
 Note that the root DOT data doesn't have a URL.  This is because we
 don't want a link to the spec we're currently looking at.
 
-    >>> print root.getDOTNodeStatement()
+    >>> print(root.getDOTNodeStatement())
     "fnord-foo"
         [
         "color"="red",
@@ -58,10 +58,10 @@
         "tooltip"="something with \" and \n in it"
         ]
 
-    >>> print g.root_node
+    >>> print(g.root_node)
     <fnord-foo>
 
-    >>> print root.name, root.label, root.URL, root.color
+    >>> print(root.name, root.label, root.URL, root.color)
     fnord-foo foo http://whatever/foo red
 
     >>> other_spec = factory.makeSpecification()
@@ -71,7 +71,7 @@
     >>> g.getNode(foo) is root
     True
 
-    >>> print g.listNodes()
+    >>> print(g.listNodes())
     Root is <fnord-foo>
     <fnord-foo>:
 
@@ -95,10 +95,10 @@
     ...     return g
 
     >>> def print_graph(dependency=True, blocked=False):
-    ...     print make_graph(dependency, blocked).listNodes()
+    ...     print(make_graph(dependency, blocked).listNodes())
 
     >>> def print_graph_dot(dependency=True, blocked=False):
-    ...     print make_graph(dependency, blocked).getDOTGraphStatement()
+    ...     print(make_graph(dependency, blocked).getDOTGraphStatement())
 
     >>> print_graph()
     Root is <fnord-foo>
@@ -261,7 +261,7 @@
     >>> isinstance(graph_view, SpecificationTreeImageTag)
     True
 
-    >>> print graph_view.render()
+    >>> print(graph_view.render())
     <img src="deptree.png" usemap="#deptree" />
     <map id="deptree" name="deptree"> ...
 
@@ -314,13 +314,13 @@
 and directly converts it into an oops report. The markup contains a
 message explaining that the image was not linked.
 
-    >>> print graph_view.render()
+    >>> print(graph_view.render())
     <img src="deptree.png" usemap="#deptree" />
     <p class="error message">There was an error linking the dependency tree
     to its specs.</p>
 
     >>> oops_report = graph_view.request.oops
-    >>> print oops_report['type'], oops_report['value']
+    >>> print(oops_report['type'], oops_report['value'])
     ProblemRenderingGraph (... syntax error in line 1 near 'bad'...)
 
     # Restore the getDotFileText() method.
@@ -350,13 +350,13 @@
 page. Again, the image map was replaced with an suggestion to reload the
 page to link the image.
 
-    >>> print graph_view.render()
+    >>> print(graph_view.render())
     <img src="deptree.png" usemap="#deptree" />
     <p class="error message">There was an error linking the dependency tree
     to its specs. Reload the page to link the image.</p>
 
     >>> oops_report = graph_view.request.oops
-    >>> print oops_report['type'], oops_report['value']
+    >>> print(oops_report['type'], oops_report['value'])
     OSError [Errno 12] Cannot allocate memory
 
 If an error occurs during the render of the PNG image, the fail over
@@ -372,7 +372,7 @@
     OSError: [Errno 12] Cannot allocate memory
 
     >>> image = graph_view.render()
-    >>> image.startswith('\x89PNG')
+    >>> image.startswith(b'\x89PNG')
     True
 
     >>> fail_over_image_length = len(image)
@@ -389,7 +389,7 @@
     ...     (svg_support, request), name="deptree.png")
     >>> graph_view.initialize()
     >>> image = graph_view.render()
-    >>> image.startswith('\x89PNG')
+    >>> image.startswith(b'\x89PNG')
     True
 
     >>> len(image) != fail_over_image_length

=== modified file 'lib/lp/blueprints/doc/specification-branch.txt'
--- lib/lp/blueprints/doc/specification-branch.txt	2013-01-30 05:31:20 +0000
+++ lib/lp/blueprints/doc/specification-branch.txt	2018-06-02 00:34:13 +0000
@@ -20,7 +20,7 @@
     >>> spec = ubuntu.getSpecification('media-integrity-check')
 
     >>> for branchlink in spec.linked_branches:
-    ...     print branchlink.branch.unique_name
+    ...     print(branchlink.branch.unique_name)
     ~name12/+junk/junk.dev
 
 We can create a new branch link with the linkBranch() method:
@@ -32,20 +32,20 @@
 
 The branch link records the person who created the link as the registrant.
 
-    >>> print branchlink.registrant.displayname
+    >>> print(branchlink.registrant.displayname)
     Sample Person
 
 Now the branch has two branch links:
 
     >>> for branchlink in spec.linked_branches:
-    ...     print branchlink.branch.unique_name
+    ...     print(branchlink.branch.unique_name)
     ~name12/+junk/junk.dev
     ~name12/+junk/junk.contrib
 
 Similarly, the branch has a list of attached specifications:
 
     >>> for speclink in branch.spec_links:
-    ...     print speclink.specification.name
+    ...     print(speclink.specification.name)
     media-integrity-check
 
 We can also look up a branch link with the getBranchLink() method:
@@ -61,5 +61,5 @@
 
     >>> spec.unlinkBranch(branch, user)
     >>> for branchlink in spec.linked_branches:
-    ...     print branchlink.branch.unique_name
+    ...     print(branchlink.branch.unique_name)
     ~name12/+junk/junk.dev

=== modified file 'lib/lp/blueprints/doc/specification-notifications.txt'
--- lib/lp/blueprints/doc/specification-notifications.txt	2011-12-24 17:49:30 +0000
+++ lib/lp/blueprints/doc/specification-notifications.txt	2018-06-02 00:34:13 +0000
@@ -40,7 +40,7 @@
     ...     subscription.person for subscription in svg_support.subscriptions]
     >>> related_people_addresses = [
     ...     [person.preferredemail.email] for person in set(related_people)]
-    >>> for addr in sorted(related_people_addresses): print addr
+    >>> for addr in sorted(related_people_addresses): print(addr)
     [u'andrew.bennetts@xxxxxxxxxxxxxxx']
     [u'carlos@xxxxxxxxxxxxx']
     [u'celso.providelo@xxxxxxxxxxxxx']
@@ -62,7 +62,7 @@
     False
 
     >>> for subscription in svg_support.subscriptions:
-    ...     print subscription.person.preferredemail.email
+    ...     print(subscription.person.preferredemail.email)
     andrew.bennetts@xxxxxxxxxxxxxxx
     daf@xxxxxxxxxxxxx
     foo.bar@xxxxxxxxxxxxx
@@ -82,7 +82,7 @@
     <...>
     >>> transaction.commit()
     >>> for fromaddr, toaddrs, message in stub.test_emails:
-    ...     print toaddrs
+    ...     print(toaddrs)
     ['test@xxxxxxxxxxxxx']
 
 Now if we edit the status, a notification will be sent to all the
@@ -104,7 +104,7 @@
 are now subscribed.
 
     >>> x = sorted(toaddrs for fromaddr, toaddrs, message in stub.test_emails)
-    >>> for addr in x: print addr
+    >>> for addr in x: print(addr)
     ['andrew.bennetts@xxxxxxxxxxxxxxx']
     ['carlos@xxxxxxxxxxxxx']
     ['daf@xxxxxxxxxxxxx']
@@ -128,7 +128,7 @@
     >>> status_notification['Subject']
     '[Blueprint svg-support] Support Native SVG Objects'
     >>> body = status_notification.get_payload(decode=True)
-    >>> print body
+    >>> print(body)
     Blueprint changed by Foo Bar:
     <BLANKLINE>
         Definition Status: Drafting => Pending Approval
@@ -168,7 +168,7 @@
     >>> status_notification['Subject']
     '[Blueprint svg-support] Support Native SVG Objects'
     >>> body = status_notification.get_payload(decode=True)
-    >>> print body
+    >>> print(body)
     Blueprint changed by Foo Bar:
     <BLANKLINE>
     Whiteboard set to:
@@ -208,7 +208,7 @@
     >>> status_notification['Subject']
     '[Blueprint svg-support] Support Native SVG Objects'
     >>> body = status_notification.get_payload(decode=True)
-    >>> print body
+    >>> print(body)
     Blueprint changed by Foo Bar:
     <BLANKLINE>
         Definition Status: Pending Approval => Approved
@@ -248,7 +248,7 @@
     >>> status_notification['Subject']
     '[Blueprint svg-support] Support Native SVG Objects'
     >>> body = status_notification.get_payload(decode=True)
-    >>> print body
+    >>> print(body)
     Blueprint changed by Foo Bar:
     <BLANKLINE>
         Priority: High => Essential
@@ -282,7 +282,7 @@
     >>> status_notification['Subject']
     '[Blueprint svg-support] Support Native SVG Objects'
     >>> body = status_notification.get_payload(decode=True)
-    >>> print body
+    >>> print(body)
     Blueprint changed by Foo Bar:
     <BLANKLINE>
         Approver: Mark Shuttleworth => (none)

=== modified file 'lib/lp/blueprints/doc/specification.txt'
--- lib/lp/blueprints/doc/specification.txt	2015-09-25 03:02:28 +0000
+++ lib/lp/blueprints/doc/specification.txt	2018-06-02 00:34:13 +0000
@@ -28,7 +28,7 @@
     ...     'http://www.silly.me/SpecName', 'we really need this',
     ...     SpecificationDefinitionStatus.APPROVED, mark,
     ...     target=upstream_firefox)
-    >>> print newspec.name
+    >>> print(newspec.name)
     mng
 
 To retrieve a specification by its ID, we use `ISpecificationSet.get`.
@@ -44,7 +44,7 @@
 And if we try to retrieve a non-existent specification we should get
 None
 
-    >>> print upstream_firefox.getSpecification('nonexistentspec')
+    >>> print(upstream_firefox.getSpecification('nonexistentspec'))
     None
 
 It's also possible to retrieve a specification by its URL
@@ -54,13 +54,13 @@
 
 And if there's no specification with the given URL we should get None
 
-    >>> print specset.getByURL('http://no-url.com')
+    >>> print(specset.getByURL('http://no-url.com'))
     None
 
 A specification could be attached to a distribution, or a product. We
 call this the specification target.
 
-    >>> print newspec.target.name
+    >>> print(newspec.target.name)
     firefox
 
 We attach now a spec to a distribution.
@@ -75,7 +75,7 @@
     ...                       SpecificationDefinitionStatus.APPROVED,
     ...                       mark,
     ...                       target=ubuntu)
-    >>> print ubuspec.name
+    >>> print(ubuspec.name)
     fix-spec-permissions
 
 The Ubuntu distro is owned by the Ubuntu team, ubuntu-team. jdub is a
@@ -83,7 +83,7 @@
 (but not specs attached to mozilla-firefox).
 
     >>> from lp.services.webapp.authorization import check_permission
-    >>> print ubuntu.owner.name
+    >>> print(ubuntu.owner.name)
     ubuntu-team
 
     >>> jdub = Person.byName('jdub')
@@ -141,58 +141,58 @@
     >>> delta.user == jdub
     True
 
-    >>> print delta.title
+    >>> print(delta.title)
     New Title
 
-    >>> print delta.summary
+    >>> print(delta.summary)
     New summary.
 
-    >>> print delta.specurl
+    >>> print(delta.specurl)
     http://www.ubuntu.com/NewSpec
 
-    >>> print delta.distroseries.name
+    >>> print(delta.distroseries.name)
     hoary
 
-    >>> print delta.name['old']
+    >>> print(delta.name['old'])
     fix-spec-permissions
 
-    >>> print delta.name['new']
+    >>> print(delta.name['new'])
     new-spec
 
-    >>> print delta.priority['old'].title
+    >>> print(delta.priority['old'].title)
     Undefined
 
-    >>> print delta.priority['new'].title
+    >>> print(delta.priority['new'].title)
     Low
 
-    >>> print delta.definition_status['old'].title
+    >>> print(delta.definition_status['old'].title)
     Approved
 
-    >>> print delta.definition_status['new'].title
+    >>> print(delta.definition_status['new'].title)
     Drafting
 
-    >>> print delta.approver['old'] is None
-    True
-
-    >>> print delta.approver['new'] == mark
-    True
-
-    >>> print delta.assignee['old'] is None
-    True
-
-    >>> print delta.assignee['new'] == jdub
-    True
-
-    >>> print delta.drafter['old'] is None
-    True
-
-    >>> print delta.drafter['new'] == jdub
-    True
-
-    >>> print delta.whiteboard['old'] is None
-    True
-
-    >>> print delta.whiteboard['new']
+    >>> print(delta.approver['old'] is None)
+    True
+
+    >>> print(delta.approver['new'] == mark)
+    True
+
+    >>> print(delta.assignee['old'] is None)
+    True
+
+    >>> print(delta.assignee['new'] == jdub)
+    True
+
+    >>> print(delta.drafter['old'] is None)
+    True
+
+    >>> print(delta.drafter['new'] == jdub)
+    True
+
+    >>> print(delta.whiteboard['old'] is None)
+    True
+
+    >>> print(delta.whiteboard['new'])
     New whiteboard comments.
 
     >>> [linked_bug.id for linked_bug in delta.bugs_linked]
@@ -220,7 +220,7 @@
 specifications:
 
     >>> for spec in specset.specifications(None, filter=[u'install']):
-    ...     print spec.name, spec.target.name
+    ...     print(spec.name, spec.target.name)
     cluster-installation kubuntu
     extension-manager-upgrades firefox
     media-integrity-check ubuntu
@@ -237,7 +237,7 @@
     >>> upstream_firefox.active = False
     >>> flush_database_updates()
     >>> for spec in specset.specifications(None, filter=[u'install']):
-    ...     print spec.name, spec.target.name
+    ...     print(spec.name, spec.target.name)
     cluster-installation kubuntu
     media-integrity-check ubuntu
 
@@ -259,25 +259,25 @@
     >>> from lp.registry.interfaces.product import IProductSet
     >>> efourx = getUtility(IProductSet).getByName(
     ...     'firefox').getSpecification('e4x')
-    >>> for spec in efourx.getDependencies(): print spec.name
-    svg-support
-
-    >>> for spec in efourx.all_deps(): print spec.name
-    svg-support
-
-    >>> for spec in efourx.getBlockedSpecs(): print spec.name
+    >>> for spec in efourx.getDependencies(): print(spec.name)
+    svg-support
+
+    >>> for spec in efourx.all_deps(): print(spec.name)
+    svg-support
+
+    >>> for spec in efourx.getBlockedSpecs(): print(spec.name)
     canvas
 
-    >>> for spec in efourx.all_blocked(): print spec.name
+    >>> for spec in efourx.all_blocked(): print(spec.name)
     canvas
 
     >>> canvas = efourx.getBlockedSpecs()[0]
     >>> svg = efourx.getDependencies()[0]
-    >>> for spec in svg.all_blocked(): print spec.name
+    >>> for spec in svg.all_blocked(): print(spec.name)
     canvas
     e4x
 
-    >>> for spec in canvas.all_deps(): print spec.name
+    >>> for spec in canvas.all_deps(): print(spec.name)
     e4x
     svg-support
 
@@ -332,9 +332,9 @@
     >>> spec_deps = [(specset.get(key).name, value) for
     ...              (key,value) in deps_dict.items()]
     >>> for (spec_name, deps) in sorted(spec_deps):
-    ...     print '%s --> %s' % (
+    ...     print('%s --> %s' % (
     ...         spec_name,
-    ...         ', '.join([dep.name for dep in deps]))
+    ...         ', '.join([dep.name for dep in deps])))
     spec-a --> spec-b, spec-c
     spec-c --> spec-d
 
@@ -354,16 +354,16 @@
 It is possible to indicate that some subscribers are essential to the
 discussion of the spec.
 
-    >>> for subscriber in canvas.subscribers: print subscriber.name
+    >>> for subscriber in canvas.subscribers: print(subscriber.name)
 
     >>> from lp.registry.interfaces.person import IPersonSet
     >>> jdub = getUtility(IPersonSet).getByName('jdub')
     >>> sub = canvas.subscribe(jdub, jdub, False)
-    >>> print sub.essential
+    >>> print(sub.essential)
     False
 
     >>> samesub = canvas.getSubscriptionByName('jdub')
-    >>> print samesub.essential
+    >>> print(samesub.essential)
     False
 
 
@@ -463,7 +463,7 @@
     >>> canvas.implementation_status.title
     'Unknown'
 
-    >>> print canvas.starter
+    >>> print(canvas.starter)
     None
 
     >>> canvas.informational
@@ -478,7 +478,7 @@
     >>> newstate is None
     False
 
-    >>> print newstate.title
+    >>> print(newstate.title)
     Started
 
     >>> canvas.starter is not None # update should have set starter
@@ -511,7 +511,7 @@
     >>> newstate is None
     False
 
-    >>> print newstate.title
+    >>> print(newstate.title)
     Not started
 
     >>> canvas.starter is not None # update should have reset starter
@@ -535,7 +535,7 @@
     >>> newstate is None
     False
 
-    >>> print newstate.title
+    >>> print(newstate.title)
     Complete
 
     >>> canvas.starter is not None # update should have set starter
@@ -560,7 +560,7 @@
     >>> newstate is None
     False
 
-    >>> print newstate.title
+    >>> print(newstate.title)
     Not started
 
     >>> canvas.starter is not None # update should have reset starter
@@ -584,7 +584,7 @@
     >>> newstate is None
     False
 
-    >>> print newstate.title
+    >>> print(newstate.title)
     Complete
 
     >>> canvas.starter is not None # update should have set starter
@@ -608,7 +608,7 @@
     >>> newstate is None
     False
 
-    >>> print newstate.title
+    >>> print(newstate.title)
     Started
 
     >>> canvas.starter is not None # update should have set starter

=== modified file 'lib/lp/blueprints/doc/sprint-agenda.txt'
--- lib/lp/blueprints/doc/sprint-agenda.txt	2018-04-19 00:02:19 +0000
+++ lib/lp/blueprints/doc/sprint-agenda.txt	2018-06-02 00:34:13 +0000
@@ -19,24 +19,24 @@
 
 Now, we should be able to see the list of sprints for the spec:
 
-    >>> print list(canvas.sprints)
+    >>> print(list(canvas.sprints))
     []
 
 And we should be able to propose the spec for the agenda:
 
     >>> sl = canvas.linkSprint(guacamole, jblack)
-    >>> for sprint in canvas.sprints: print sprint.name
+    >>> for sprint in canvas.sprints: print(sprint.name)
     uds-guacamole
-    >>> print sl.registrant.name, sl.status.title
+    >>> print(sl.registrant.name, sl.status.title)
     jblack Proposed
-    >>> print sl.decider, sl.date_decided
+    >>> print(sl.decider, sl.date_decided)
     None None
 
 Now, it should be possible to accept the proposal. That should set the
 status accordingly and also update the decider and the date_decided.
 
     >>> sl.acceptBy(danner)
-    >>> print sl.status.title, sl.decider.name, sl.date_decided is not None
+    >>> print(sl.status.title, sl.decider.name, sl.date_decided is not None)
     Accepted danner True
 
 It is possible to revise your choice, declining the spec. This should update
@@ -51,9 +51,7 @@
     >>> from zope.security.proxy import removeSecurityProxy
     >>> removeSecurityProxy(sl).date_decided = None
     >>> sl.declineBy(jblack)
-    >>> print sl.status.title, sl.decider.name, sl.date_decided is not None
+    >>> print(sl.status.title, sl.decider.name, sl.date_decided is not None)
     Declined jblack True
-    >>> print sl.date_decided == transaction_timestamp
+    >>> print(sl.date_decided == transaction_timestamp)
     True
-
-

=== modified file 'lib/lp/blueprints/doc/sprint-meeting-export.txt'
--- lib/lp/blueprints/doc/sprint-meeting-export.txt	2017-04-10 10:49:19 +0000
+++ lib/lp/blueprints/doc/sprint-meeting-export.txt	2018-06-02 00:34:13 +0000
@@ -55,7 +55,7 @@
     2
 
     >>> for spec in view.specifications:
-    ...     print spec['spec'].name
+    ...     print(spec['spec'].name)
     svg-support
     extension-manager-upgrades
 
@@ -99,23 +99,23 @@
     >>> len(view.attendees)
     1
 
-    >>> print view.attendees[0]['name']
+    >>> print(view.attendees[0]['name'])
     name12
 
-    >>> print view.attendees[0]['displayname']
+    >>> print(view.attendees[0]['displayname'])
     Sample Person
 
-    >>> print view.attendees[0]['start']
+    >>> print(view.attendees[0]['start'])
     2005-10-08T07:00:00Z
 
-    >>> print view.attendees[0]['end']
+    >>> print(view.attendees[0]['end'])
     2005-11-17T20:00:00Z
 
 If a specification's priority is undefined or marked as not for us, then
 it is not included in the meeting list for the sprint.  The javascript
 spec is one such spec.  First we will accept it for the sprint:
 
-    >>> print js_spec.priority.name
+    >>> print(js_spec.priority.name)
     NOTFORUS
 
     >>> link = js_spec.sprint_links[0]

=== modified file 'lib/lp/blueprints/doc/sprint.txt'
--- lib/lp/blueprints/doc/sprint.txt	2017-04-08 16:58:52 +0000
+++ lib/lp/blueprints/doc/sprint.txt	2018-06-02 00:34:13 +0000
@@ -30,31 +30,31 @@
 and-coming (sorted by the starting date):
 
     >>> for sprint in firefox.coming_sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
     futurista 2025-08-16
 
     >>> for sprint in ubuntu.coming_sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
     futurista 2025-08-16
 
     >>> for sprint in mozilla.coming_sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
     futurista 2025-08-16
 
 And we have sprints, giving us all sprints relevant to that pillar
 (sorted descending by the starting date):
 
     >>> for sprint in firefox.sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
     futurista 2025-08-16
     ubz 2005-10-07
 
     >>> for sprint in ubuntu.sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
     futurista 2025-08-16
 
     >>> for sprint in mozilla.sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
     futurista 2025-08-16
     ubz 2005-10-07
 
@@ -62,14 +62,14 @@
 that are not coming sprints.
 
     >>> for sprint in firefox.past_sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
     ubz 2005-10-07
 
     >>> for sprint in ubuntu.past_sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
 
     >>> for sprint in mozilla.past_sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
     ubz 2005-10-07
 
 Now, these sprint APIs show only sprints with specifications that are
@@ -98,10 +98,10 @@
 See, there are no ubuntu sprints.
 
     >>> for sprint in ubuntu.sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
 
     >>> for sprint in ubuntu.coming_sprints:
-    ...     print sprint.name, sprint.time_starts.strftime('%Y-%m-%d')
+    ...     print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
 
 
 Specification Listings
@@ -133,7 +133,7 @@
 
     >>> filter = [SpecificationFilter.INCOMPLETE]
     >>> for spec in ubz.specifications(None, filter=filter):
-    ...    print spec.name, spec.is_complete
+    ...    print(spec.name, spec.is_complete)
     svg-support False
     extension-manager-upgrades False
     e4x False
@@ -142,7 +142,7 @@
 
     >>> filter = [SpecificationFilter.ALL]
     >>> for spec in ubz.specifications(None, filter=filter):
-    ...    print spec.priority.title, spec.name
+    ...    print(spec.priority.title, spec.name)
     High svg-support
     Medium extension-manager-upgrades
     Not e4x
@@ -150,7 +150,7 @@
 And if we ask just for specs, we get them all
 
     >>> for spec in ubz.specifications(None):
-    ...     print spec.name, spec.is_complete
+    ...     print(spec.name, spec.is_complete)
     svg-support False
     extension-manager-upgrades False
     e4x False
@@ -230,31 +230,31 @@
 The attend() method can update a user's attendance if there is already a
 ISprintAttendance for the user.
 
-    >>> print sprint_attendance.attendee.name
+    >>> print(sprint_attendance.attendee.name)
     mustard
 
-    >>> print sprint_attendance.time_starts
+    >>> print(sprint_attendance.time_starts)
     2005-10-07 09:00:00+00:00
 
-    >>> print sprint_attendance.time_ends
+    >>> print(sprint_attendance.time_ends)
     2005-10-17 19:05:00+00:00
 
-    >>> print sprint_attendance.is_physical
+    >>> print(sprint_attendance.is_physical)
     True
 
     >>> time_starts = datetime.datetime(2005, 10, 8, 9, 0, 0, 0, UTC)
     >>> time_ends = datetime.datetime(2005, 10, 16, 19, 5, 0, 0, UTC)
     >>> new_attendance = ubz.attend(person, time_starts, time_ends, False)
-    >>> print new_attendance.attendee.name
+    >>> print(new_attendance.attendee.name)
     mustard
 
-    >>> print new_attendance.time_starts
+    >>> print(new_attendance.time_starts)
     2005-10-08 09:00:00+00:00
 
-    >>> print new_attendance.time_ends
+    >>> print(new_attendance.time_ends)
     2005-10-16 19:05:00+00:00
 
-    >>> print new_attendance.is_physical
+    >>> print(new_attendance.is_physical)
     False
 
 The sprint attendances property returns a list of SprintAttendance
@@ -264,7 +264,7 @@
     [<...SprintAttendance ...>]
 
     >>> for attendance in ubz.attendances:
-    ...     print attendance.attendee.name
+    ...     print(attendance.attendee.name)
     mustard
 
 

=== modified file 'lib/lp/blueprints/doc/sprintattendance.txt'
--- lib/lp/blueprints/doc/sprintattendance.txt	2012-12-26 01:32:19 +0000
+++ lib/lp/blueprints/doc/sprintattendance.txt	2018-06-02 00:34:13 +0000
@@ -29,17 +29,17 @@
 
 The sprint and user can be accessed via the sprint and user attributes.
 
-    >>> print sprint_attendance.sprint.title
+    >>> print(sprint_attendance.sprint.title)
     lunarbase
-    >>> print sprint_attendance.attendee.name
+    >>> print(sprint_attendance.attendee.name)
     scarlet
 
 The time of the users arrival and departure can be retrieved from the
 time_start and time_end attributes respectively.
 
-    >>> print sprint_attendance.time_starts
+    >>> print(sprint_attendance.time_starts)
     2019-06-21 00:00:00+00:00
-    >>> print sprint_attendance.time_ends
+    >>> print(sprint_attendance.time_ends)
     2019-07-04 00:00:00+00:00
 
 SprintAttendance records whether the user intend to be physically present

=== modified file 'lib/lp/blueprints/tests/test_doc.py'
--- lib/lp/blueprints/tests/test_doc.py	2017-10-25 13:10:41 +0000
+++ lib/lp/blueprints/tests/test_doc.py	2018-06-02 00:34:13 +0000
@@ -8,10 +8,11 @@
 import os
 
 from lp.services.testing import build_test_suite
+from lp.testing.systemdocs import setUp
 
 
 here = os.path.dirname(os.path.realpath(__file__))
 
 
 def test_suite():
-    return build_test_suite(here)
+    return build_test_suite(here, setUp=lambda test: setUp(test, future=True))


Follow ups