← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:doctest-source-line-length into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:doctest-source-line-length into launchpad:master.

Commit message:
lp-lint-doctest: Fix "source exceeds 78 characters" errors

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

This is almost entirely just reformatting.  In a couple of cases I removed now-redundant "u" prefixes from strings where that was the simplest way to make the line fit.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:doctest-source-line-length into launchpad:master.
diff --git a/lib/lp/answers/doc/question.txt b/lib/lp/answers/doc/question.txt
index d25ef30..cb1b002 100644
--- a/lib/lp/answers/doc/question.txt
+++ b/lib/lp/answers/doc/question.txt
@@ -346,7 +346,8 @@ that language.  IQuestionTarget can return a list of Questions in languages
 that are not supported.
 
     >>> unsupported_questions = firefox.searchQuestions(unsupported=True)
-    >>> for question in sorted(unsupported_questions, key=attrgetter('title')):
+    >>> for question in sorted(
+    ...         unsupported_questions, key=attrgetter('title')):
     ...     print(question.title)
     Problemas de Impressão no Firefox
 
@@ -358,7 +359,8 @@ that are not supported.
     >>> warty_question_target = IQuestionTarget(ubuntu_warty)
     >>> unsupported_questions = warty_question_target.searchQuestions(
     ...     unsupported=True)
-    >>> for question in sorted(unsupported_questions, key=attrgetter('title')):
+    >>> for question in sorted(
+    ...         unsupported_questions, key=attrgetter('title')):
     ...     print(question.title)
     Problema al recompilar kernel con soporte smp (doble-núcleo)
     عكس التغييرات غير المحفوظة للمستن؟
diff --git a/lib/lp/answers/stories/question-overview.txt b/lib/lp/answers/stories/question-overview.txt
index 54afeb6..9005d90 100644
--- a/lib/lp/answers/stories/question-overview.txt
+++ b/lib/lp/answers/stories/question-overview.txt
@@ -61,7 +61,8 @@ question page.
     >>> print(browser.title)
     Question #2 : ...
 
-    >>> print(find_main_content(browser.contents).find('h1').decode_contents())
+    >>> print(find_main_content(
+    ...     browser.contents).find('h1').decode_contents())
     Problem showing the SVG demo on W3C site
 
 
@@ -197,7 +198,8 @@ involving a person.
     >>> print(browser.title)
     Questions : Foo Bar
 
-    >>> print(find_main_content(browser.contents).find('h1').decode_contents())
+    >>> print(find_main_content(
+    ...     browser.contents).find('h1').decode_contents())
     Questions for Foo Bar
 
     >>> browser.getLink('Slow system').url
@@ -222,7 +224,8 @@ the proper context where the question can be found:
     >>> print(browser.url)
     http://answers.launchpad.test/firefox/+question/1
 
-    >>> print(find_main_content(browser.contents).find('h1').decode_contents())
+    >>> print(find_main_content(
+    ...     browser.contents).find('h1').decode_contents())
     Firefox cannot render Bank Site
 
 This also works on the webservice.
diff --git a/lib/lp/answers/stories/question-reject-and-change-status.txt b/lib/lp/answers/stories/question-reject-and-change-status.txt
index bdbffe2..b7b615b 100644
--- a/lib/lp/answers/stories/question-reject-and-change-status.txt
+++ b/lib/lp/answers/stories/question-reject-and-change-status.txt
@@ -25,7 +25,8 @@ error.
 
 To reject the question, the user clicks on the 'Reject Question' link.
 
-    >>> admin_browser.open('http://answers.launchpad.test/firefox/+question/2')
+    >>> admin_browser.open(
+    ...     'http://answers.launchpad.test/firefox/+question/2')
     >>> admin_browser.getLink('Reject question').click()
     >>> admin_browser.getControl('Reject').click()
 
diff --git a/lib/lp/app/browser/doc/base-layout.txt b/lib/lp/app/browser/doc/base-layout.txt
index f091fc9..f755353 100644
--- a/lib/lp/app/browser/doc/base-layout.txt
+++ b/lib/lp/app/browser/doc/base-layout.txt
@@ -80,7 +80,8 @@ slots are rendered, as are the application tabs.
     >>> class SearchlessView(LaunchpadView):
     ...     """A simple view to test base-layout."""
     ...     __launchpad_facetname__ = 'overview'
-    ...     template = ViewPageTemplateFile('../tests/testfiles/searchless.pt')
+    ...     template = ViewPageTemplateFile(
+    ...         '../tests/testfiles/searchless.pt')
     ...     page_title = 'Test base-layout: searchless'
 
     >>> view = SearchlessView(user, request)
diff --git a/lib/lp/app/doc/launchpadform.txt b/lib/lp/app/doc/launchpadform.txt
index 58239fb..7b0f67b 100644
--- a/lib/lp/app/doc/launchpadform.txt
+++ b/lib/lp/app/doc/launchpadform.txt
@@ -488,7 +488,7 @@ template and thus is way simpler.
     >>> from zope.browserpage import ViewPageTemplateFile
     >>> file, filename = mkstemp()
     >>> f = open(filename, 'w')
-    >>> _ = f.write(u'<div metal:use-macro="context/@@launchpad_form/form" />')
+    >>> _ = f.write('<div metal:use-macro="context/@@launchpad_form/form" />')
     >>> f.close()
 
 By default, all widgets are visible.
diff --git a/lib/lp/app/stories/basics/max-batch-size.txt b/lib/lp/app/stories/basics/max-batch-size.txt
index 71c9635..dd986ef 100644
--- a/lib/lp/app/stories/basics/max-batch-size.txt
+++ b/lib/lp/app/stories/basics/max-batch-size.txt
@@ -7,7 +7,8 @@ products will display a page telling the users that the batch is too
 large and what is the current maximum.
 
     >>> anon_browser.handleErrors = True
-    >>> anon_browser.open('http://launchpad.test/projects/+all?start=0&batch=1000')
+    >>> anon_browser.open(
+    ...     'http://launchpad.test/projects/+all?start=0&batch=1000')
     Traceback (most recent call last):
     ...
     urllib.error.HTTPError: HTTP Error 400: Bad Request
diff --git a/lib/lp/app/stories/basics/notfound-traversals.txt b/lib/lp/app/stories/basics/notfound-traversals.txt
index 4a6cc78..7b2650c 100644
--- a/lib/lp/app/stories/basics/notfound-traversals.txt
+++ b/lib/lp/app/stories/basics/notfound-traversals.txt
@@ -12,7 +12,8 @@ HTTP status is returned.
     ...             "%s returned status %s instead of 404\n\n%s" % (
     ...                 url, status, str(output)))
 
-    >>> def check_redirect(url, auth=False, host='launchpad.test', status=303):
+    >>> def check_redirect(url, auth=False, host='launchpad.test',
+    ...                    status=303):
     ...     get_cmd = """
     ... GET %s HTTP/1.1
     ... Host: %s
diff --git a/lib/lp/app/stories/form/xx-form-layout.txt b/lib/lp/app/stories/form/xx-form-layout.txt
index 478c97e..726f713 100644
--- a/lib/lp/app/stories/form/xx-form-layout.txt
+++ b/lib/lp/app/stories/form/xx-form-layout.txt
@@ -54,7 +54,8 @@ Checkboxes have their label to the right. Let's look at one example.
 
     >>> admin_browser.open(
     ...     'http://launchpad.test/firefox/+review-license')
-    >>> print(find_tag_by_id(admin_browser.contents, 'launchpad-form-widgets'))
+    >>> print(find_tag_by_id(
+    ...     admin_browser.contents, 'launchpad-form-widgets'))
     <...
     <tr>
       <td colspan="2">
diff --git a/lib/lp/archiveuploader/tests/nascentupload-packageset.txt b/lib/lp/archiveuploader/tests/nascentupload-packageset.txt
index 3397177..70e3626 100644
--- a/lib/lp/archiveuploader/tests/nascentupload-packageset.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload-packageset.txt
@@ -4,9 +4,13 @@ In order to prepare the tests below some initialization is required.
     >>> from lp.archiveuploader.nascentupload import NascentUpload
     >>> from lp.archiveuploader.tests import datadir, getPolicy
     >>> from lp.registry.interfaces.person import IPersonSet
-    >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
+    >>> from lp.registry.interfaces.sourcepackagename import (
+    ...     ISourcePackageNameSet,
+    ...     )
     >>> from lp.soyuz.enums import ArchivePermissionType
-    >>> from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet
+    >>> from lp.soyuz.interfaces.archivepermission import (
+    ...     IArchivePermissionSet,
+    ...     )
     >>> from lp.soyuz.interfaces.packageset import IPackagesetSet
     >>> from lp.testing.dbuser import switch_dbuser
 
diff --git a/lib/lp/blueprints/stories/blueprints/xx-buglinks.txt b/lib/lp/blueprints/stories/blueprints/xx-buglinks.txt
index 04ea753..f01fd00 100644
--- a/lib/lp/blueprints/stories/blueprints/xx-buglinks.txt
+++ b/lib/lp/blueprints/stories/blueprints/xx-buglinks.txt
@@ -12,7 +12,8 @@ the 'Related Bugs' section.
 
     >>> anon_browser.open(
     ...     'http://launchpad.test/firefox/+spec/svg-support')
-    >>> print(extract_text(find_tag_by_id(anon_browser.contents, 'bug_links')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     anon_browser.contents, 'bug_links')))
     Related bugs
     Bug #1: Firefox does not support SVG   New
 
@@ -26,7 +27,8 @@ Linking a bug report to a specification is done by using the
 This link is only available to registered users:
 
     >>> user_browser.open(
-    ...     'http://blueprints.launchpad.test/firefox/+spec/svg-support/+linkbug')
+    ...     'http://blueprints.launchpad.test/firefox/+spec/svg-support/'
+    ...     '+linkbug')
     >>> user_browser.url
     'http://blueprints.launchpad.test/firefox/+spec/svg-support/+linkbug'
     >>> back_link = user_browser.getLink('Support Native SVG Objects')
diff --git a/lib/lp/blueprints/stories/blueprints/xx-creation.txt b/lib/lp/blueprints/stories/blueprints/xx-creation.txt
index c95ab67..128b233 100644
--- a/lib/lp/blueprints/stories/blueprints/xx-creation.txt
+++ b/lib/lp/blueprints/stories/blueprints/xx-creation.txt
@@ -178,7 +178,8 @@ From a sprint
 
 Starting from the Future Mega Meeting sprint page:
 
-    >>> user_browser.open('http://blueprints.launchpad.test/sprints/futurista')
+    >>> user_browser.open(
+    ...     'http://blueprints.launchpad.test/sprints/futurista')
 
 Users can also follow the textual "Register a blueprint" link:
 
diff --git a/lib/lp/blueprints/stories/sprints/xx-sprints.txt b/lib/lp/blueprints/stories/sprints/xx-sprints.txt
index ea2e537..d1e78c7 100644
--- a/lib/lp/blueprints/stories/sprints/xx-sprints.txt
+++ b/lib/lp/blueprints/stories/sprints/xx-sprints.txt
@@ -131,7 +131,8 @@ the new sprint.
 Since the sprint's time zone was set to UTC, the dates are displayed in
 that time zone:
 
-    >>> print(extract_text(find_tag_by_id(user_browser.contents, 'start-end')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     user_browser.contents, 'start-end')))
     Starts: 09:15 UTC on Tuesday, 2006-10-10
     Ends: 16:00 UTC on Friday, 2006-10-13
 
@@ -160,7 +161,8 @@ Add a new sprint with a different time zone is also handled correctly.
     >>> user_browser.url
     'http://launchpad.test/sprints/africa-sprint'
 
-    >>> print(extract_text(find_tag_by_id(user_browser.contents, 'start-end')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     user_browser.contents, 'start-end')))
     Starts: 09:15 SAST on Monday, 2006-07-10
     Ends: 16:00 SAST on Thursday, 2006-07-13
 
@@ -234,7 +236,8 @@ sprint home page.
 
 The address of the sprint is now visible.
 
-    >>> print(extract_text(find_tag_by_id(browser.contents, 'sprint-address')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, 'sprint-address')))
     Address: Holiday Inn Select, Downtown Montreal, Canada
 
     >>> print(extract_text(find_tag_by_id(browser.contents, 'start-end')))
diff --git a/lib/lp/blueprints/stories/standalone/xx-batching.txt b/lib/lp/blueprints/stories/standalone/xx-batching.txt
index 828d18c..7ff5feb 100644
--- a/lib/lp/blueprints/stories/standalone/xx-batching.txt
+++ b/lib/lp/blueprints/stories/standalone/xx-batching.txt
@@ -33,7 +33,8 @@ In the beginning, a project hasn't had blueprints set up:
 But it's easy to change that.
 
     >>> browser.open(
-    ...     "http://blueprints.launchpad.test/big-project/+configure-blueprints";)
+    ...     "http://blueprints.launchpad.test/big-project/";
+    ...     "+configure-blueprints")
     >>> browser.getControl(
     ...     name='field.blueprints_usage').value = ['LAUNCHPAD']
     >>> browser.getControl('Change').click()
diff --git a/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.txt b/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.txt
index 0603ab6..5e653eb 100644
--- a/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.txt
+++ b/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.txt
@@ -16,7 +16,8 @@ implementation.
 
 We register a new blueprint.
 
-    >>> user_browser.open('http://blueprints.launchpad.test/jokosher/+addspec')
+    >>> user_browser.open(
+    ...     'http://blueprints.launchpad.test/jokosher/+addspec')
     >>> user_browser.getControl('Name').value = 'informational-blueprint'
     >>> user_browser.getControl('Title').value = 'Informational blueprint'
     >>> user_browser.getControl('Summary').value = \
@@ -49,7 +50,8 @@ project's documentation page.
     >>> user_browser.getLink(url='+status').click()
     >>> user_browser.getControl('Definition Status').value = ['APPROVED']
     >>> user_browser.getControl('Change').click()
-    >>> browser.open('http://blueprints.launchpad.test/jokosher/+documentation')
+    >>> browser.open(
+    ...     'http://blueprints.launchpad.test/jokosher/+documentation')
     >>> print(extract_text(
     ...     find_tag_by_id(browser.contents, 'documentation-listing-table')))
     ...
diff --git a/lib/lp/bugs/browser/tests/bugtask-search-views.txt b/lib/lp/bugs/browser/tests/bugtask-search-views.txt
index 041a1fa..3645cdf 100644
--- a/lib/lp/bugs/browser/tests/bugtask-search-views.txt
+++ b/lib/lp/bugs/browser/tests/bugtask-search-views.txt
@@ -150,7 +150,8 @@ message.
     >>> distro_advanced_search_listingview = create_view(
     ...     debian, '+bugs', form_values)
 
-    >>> print(distro_advanced_search_listingview.getFieldError('bug_reporter'))
+    >>> print(
+    ...     distro_advanced_search_listingview.getFieldError('bug_reporter'))
     There&#x27;s no person with the name or email address &#x27;invalid-reporter&#x27;.
 
 The same if we try with an invalid assignee.
@@ -225,7 +226,8 @@ The simple search form returns only open bugtasks.
     ...     sarge, "+bugs", form_values)
 
     >>> open_bugtasks = list(distroseries_search_listingview.search().batch)
-    >>> [(bugtask.id, bugtask.bug.id, bugtask.status.name, bugtask.importance.name)
+    >>> [(bugtask.id, bugtask.bug.id, bugtask.status.name,
+    ...   bugtask.importance.name)
     ...  for bugtask in open_bugtasks]
     [(19, 3, 'NEW', 'MEDIUM')]
 
@@ -329,7 +331,8 @@ And the advanced form allows us to query for specific bug statuses.
     ...     'field.searchtext': '',
     ...     'field.orderby': '-importance'}
 
-    >>> mozilla_search_listingview = create_view(mozilla, '+bugs', form_values)
+    >>> mozilla_search_listingview = create_view(
+    ...     mozilla, '+bugs', form_values)
     >>> invalid_bugtasks = list(mozilla_search_listingview.search().batch)
     >>> for bugtask in invalid_bugtasks:
     ...     print(bugtask.bug.id, bugtask.product.name, bugtask.status.name)
@@ -381,7 +384,8 @@ Submit the search:
     ...     'field.searchtext': '',
     ...     'field.orderby': '-importance'}
 
-    >>> mozilla_search_listingview = create_view(mozilla, '+bugs', form_values)
+    >>> mozilla_search_listingview = create_view(
+    ...     mozilla, '+bugs', form_values)
     >>> userdata_bugtasks = list(mozilla_search_listingview.search().batch)
     >>> for bugtask in userdata_bugtasks:
     ...     print(bugtask.bug.id, bugtask.product.name,
diff --git a/lib/lp/bugs/doc/bug-set-status.txt b/lib/lp/bugs/doc/bug-set-status.txt
index 89caa02..4c4f033 100644
--- a/lib/lp/bugs/doc/bug-set-status.txt
+++ b/lib/lp/bugs/doc/bug-set-status.txt
@@ -15,7 +15,8 @@ changing the status, the target, and the new status.
     ...     login('no-priv@xxxxxxxxxxxxx')
     ...     no_priv = getUtility(IPersonSet).getByName('no-priv')
     ...     bug_params = CreateBugParams(
-    ...         owner=no_priv, title='Sample bug', comment='This is a sample bug.')
+    ...         owner=no_priv, title='Sample bug',
+    ...         comment='This is a sample bug.')
     ...     firefox = getUtility(IProductSet).getByName('firefox')
     ...     bug = firefox.createBug(bug_params)
     ...     bug_id = bug.id
@@ -163,7 +164,8 @@ If a source package is given, but no such package exists, no bugtask
 will be edited.
 
     >>> ubuntu_firefox = ubuntu.getSourcePackage('mozilla-firefox')
-    >>> bug.setStatus(ubuntu_firefox, BugTaskStatus.CONFIRMED, no_priv) is None
+    >>> bug.setStatus(
+    ...     ubuntu_firefox, BugTaskStatus.CONFIRMED, no_priv) is None
     True
 
 If the bug is targeted to a source package, that bugtask is of course
@@ -226,7 +228,8 @@ targeted to the non-current series of course.
     >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
     >>> ubuntu_warty = ubuntu.getSeries('warty')
     >>> warty_firefox = ubuntu_warty.getSourcePackage('mozilla-firefox')
-    >>> bug.setStatus(warty_firefox, BugTaskStatus.INCOMPLETE, no_priv) is None
+    >>> bug.setStatus(
+    ...     warty_firefox, BugTaskStatus.INCOMPLETE, no_priv) is None
     True
 
     >>> login('foo.bar@xxxxxxxxxxxxx')
diff --git a/lib/lp/bugs/doc/bugattachments.txt b/lib/lp/bugs/doc/bugattachments.txt
index 5a96419..2b63a94 100644
--- a/lib/lp/bugs/doc/bugattachments.txt
+++ b/lib/lp/bugs/doc/bugattachments.txt
@@ -267,7 +267,8 @@ Let's try uploading a file with some weird characters in them:
     >>> len(add_comment_view.errors)
     0
     >>> attachments = bug_four.attachments
-    >>> print(attachments[bug_four.attachments.count()-1].libraryfile.filename)
+    >>> print(
+    ...     attachments[bug_four.attachments.count()-1].libraryfile.filename)
     foö bar
     >>> attachments[bug_four.attachments.count()-1].libraryfile.http_url
     'http://.../fo%C3%B6%20bar'
diff --git a/lib/lp/bugs/doc/bugnotifications.txt b/lib/lp/bugs/doc/bugnotifications.txt
index 08f6490..d177713 100644
--- a/lib/lp/bugs/doc/bugnotifications.txt
+++ b/lib/lp/bugs/doc/bugnotifications.txt
@@ -34,7 +34,9 @@ Reporting a new bug
     >>> from lp.registry.interfaces.distroseries import IDistroSeriesSet
     >>> from lp.registry.interfaces.person import IPersonSet
     >>> from lp.registry.interfaces.product import IProductSet
-    >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
+    >>> from lp.registry.interfaces.sourcepackagename import (
+    ...     ISourcePackageNameSet,
+    ...     )
 
     >>> bug_submitter = getUtility(IPersonSet).get(12)
     >>> firefox = getUtility(IProductSet).get(4)
diff --git a/lib/lp/bugs/doc/bugtarget.txt b/lib/lp/bugs/doc/bugtarget.txt
index 59a60fd..1d86f3a 100644
--- a/lib/lp/bugs/doc/bugtarget.txt
+++ b/lib/lp/bugs/doc/bugtarget.txt
@@ -23,7 +23,8 @@ target (such as in filterable email messages).
     >>> firefox = getUtility(IProductSet).getByName("firefox")
     >>> firefox_1_0 = firefox.getSeries("1.0")
     >>> debian_woody = debian.getSeries("woody")
-    >>> debian_woody_firefox = debian_woody.getSourcePackage("mozilla-firefox")
+    >>> debian_woody_firefox = debian_woody.getSourcePackage(
+    ...     "mozilla-firefox")
 
     >>> IBugTarget.providedBy(firefox)
     True
diff --git a/lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt b/lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt
index d2dbd78..d6bfbf8 100644
--- a/lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt
+++ b/lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt
@@ -330,7 +330,9 @@ means that we can use it to import comments from the remote Bugzilla
 instance.
 
     >>> from lp.testing import verifyObject
-    >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
+    >>> from lp.bugs.interfaces.externalbugtracker import (
+    ...     ISupportsCommentImport,
+    ...     )
     >>> verifyObject(ISupportsCommentImport, bugzilla)
     True
 
diff --git a/lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt b/lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt
index 05bbcb5..c47051d 100644
--- a/lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt
+++ b/lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt
@@ -54,7 +54,8 @@ Tracker:
     >>> from lp.bugs.tests.externalbugtracker import (
     ...     TestMantis)
 
-    >>> sample_person = getUtility(IPersonSet).getByEmail('test@xxxxxxxxxxxxx')
+    >>> sample_person = getUtility(IPersonSet).getByEmail(
+    ...     'test@xxxxxxxxxxxxx')
 
     >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities
     >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
diff --git a/lib/lp/bugs/doc/externalbugtracker-mantis.txt b/lib/lp/bugs/doc/externalbugtracker-mantis.txt
index 0a15a0e..9ccf856 100644
--- a/lib/lp/bugs/doc/externalbugtracker-mantis.txt
+++ b/lib/lp/bugs/doc/externalbugtracker-mantis.txt
@@ -57,7 +57,8 @@ Tracker:
     >>> from lp.bugs.tests.externalbugtracker import (
     ...     TestMantis)
 
-    >>> sample_person = getUtility(IPersonSet).getByEmail('test@xxxxxxxxxxxxx')
+    >>> sample_person = getUtility(IPersonSet).getByEmail(
+    ...     'test@xxxxxxxxxxxxx')
 
     >>> example_bug_tracker = new_bugtracker(BugTrackerType.MANTIS)
 
diff --git a/lib/lp/bugs/doc/externalbugtracker-roundup.txt b/lib/lp/bugs/doc/externalbugtracker-roundup.txt
index 44c577b..49db154 100644
--- a/lib/lp/bugs/doc/externalbugtracker-roundup.txt
+++ b/lib/lp/bugs/doc/externalbugtracker-roundup.txt
@@ -125,7 +125,8 @@ First, we create some bug watches to test with:
 
     >>> from lp.bugs.interfaces.bug import IBugSet
     >>> from lp.registry.interfaces.person import IPersonSet
-    >>> sample_person = getUtility(IPersonSet).getByEmail('test@xxxxxxxxxxxxx')
+    >>> sample_person = getUtility(IPersonSet).getByEmail(
+    ...     'test@xxxxxxxxxxxxx')
 
     >>> example_bug_tracker = new_bugtracker(BugTrackerType.ROUNDUP)
 
diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.txt b/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.txt
index 3b0f4c5..8d5d055 100644
--- a/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.txt
+++ b/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.txt
@@ -376,7 +376,8 @@ need to make sure that everything is quoted before displaying the input.
     ...     'http://launchpad.test/debian/+source/mozilla-firefox/+bug/3'
     ...     '/+choose-affected-product')
 
-    >>> user_browser.getControl('Project').value = b'N\xc3\xb6 Such Product&<>'
+    >>> user_browser.getControl('Project').value = (
+    ...     b'N\xc3\xb6 Such Product&<>')
     >>> user_browser.getControl('Continue').click()
     >>> print(user_browser.url)
     http://.../debian/+source/mozilla-firefox/+bug/3/+choose-affected-product
diff --git a/lib/lp/bugs/stories/bug-release-management/xx-bug-release-management.txt b/lib/lp/bugs/stories/bug-release-management/xx-bug-release-management.txt
index 9dff651..b8b6462 100644
--- a/lib/lp/bugs/stories/bug-release-management/xx-bug-release-management.txt
+++ b/lib/lp/bugs/stories/bug-release-management/xx-bug-release-management.txt
@@ -303,7 +303,8 @@ The use of the Won't Fix status is restricted. We need to use it to
 illustrate conjoined bugtasks, so we'll make 'no-priv' the bug supervisor
 for Firefox:
 
-    >>> admin_browser.open('http://bugs.launchpad.test/firefox/+bugsupervisor')
+    >>> admin_browser.open(
+    ...     'http://bugs.launchpad.test/firefox/+bugsupervisor')
     >>> admin_browser.getControl('Bug Supervisor').value = 'no-priv'
     >>> admin_browser.getControl('Change').click()
 
diff --git a/lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-listings-page.txt b/lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-listings-page.txt
index 268b470..0ca1f7c 100644
--- a/lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-listings-page.txt
+++ b/lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-listings-page.txt
@@ -6,7 +6,8 @@ using Javascript after page load.
     >>> anon_browser.getLink(id='tags-content-link').click()
     >>> print(anon_browser.url)
     http://launchpad.test/ubuntu/+bugtarget-portlet-tags-content
-    >>> tags_portlet = find_tags_by_class(anon_browser.contents, 'data-list')[0]
+    >>> tags_portlet = find_tags_by_class(
+    ...     anon_browser.contents, 'data-list')[0]
     >>> for a_tag in tags_portlet('a'):
     ...     print(a_tag.decode_contents())
     crash
diff --git a/lib/lp/bugs/stories/bugattachments/xx-bugattachments.txt b/lib/lp/bugs/stories/bugattachments/xx-bugattachments.txt
index 01f6659..c691592 100644
--- a/lib/lp/bugs/stories/bugattachments/xx-bugattachments.txt
+++ b/lib/lp/bugs/stories/bugattachments/xx-bugattachments.txt
@@ -400,7 +400,8 @@ And another patch...
 
 And now we'll search for patches for firefox bugs.
 
-    >>> user_browser.open("http://bugs.launchpad.test/firefox/+bugs?advanced=1";)
+    >>> user_browser.open(
+    ...     "http://bugs.launchpad.test/firefox/+bugs?advanced=1";)
     >>> user_browser.getControl(
     ...     "Show only bugs with patches available").selected = True
     >>> user_browser.getControl("Search", index=1).click()
diff --git a/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt b/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
index 00561d1..5e3fb62 100644
--- a/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
+++ b/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
@@ -58,7 +58,8 @@ But this delete option should not be shown for other users.
     >>> logout()
 
     >>> another_browser.open('http://launchpad.test/bugs/2')
-    >>> another_browser.getLink(url=re.compile(r'.*/\+attachment/\d+$')).click()
+    >>> another_browser.getLink(
+    ...     url=re.compile(r'.*/\+attachment/\d+$')).click()
     >>> print(another_browser.title)
     Bug #2...
     >>> try:
diff --git a/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.txt b/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.txt
index 4d94cd4..6d7f375 100644
--- a/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.txt
+++ b/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.txt
@@ -12,7 +12,8 @@ File size and mime type are displayed for each attachment
     >>> user_browser.getControl("Attachment").add_file(
     ...     foo_file, "text/plain", "foo.txt")
     >>> user_browser.getControl("Description").value = "description text"
-    >>> user_browser.getControl(name="field.comment").value = "comment comment"
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "comment comment")
     >>> user_browser.getControl("Post Comment").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/firefox/+bug/1'
@@ -42,7 +43,8 @@ A filesize of 2700 byte is displayed in 'KiB'
     >>> user_browser.getControl("Attachment").add_file(
     ...     foo_file, "text/plain", "foo.txt")
     >>> user_browser.getControl("Description").value = "description text"
-    >>> user_browser.getControl(name="field.comment").value = "comment comment"
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "comment comment")
     >>> user_browser.getControl("Post Comment").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/firefox/+bug/1'
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-edit.txt b/lib/lp/bugs/stories/bugs/xx-bug-edit.txt
index 7e888cd..02195c1 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-edit.txt
+++ b/lib/lp/bugs/stories/bugs/xx-bug-edit.txt
@@ -16,7 +16,8 @@ And now we show that any logged-in user can edit public bugs.
 
     >>> browser = setupBrowser(auth='Basic no-priv@xxxxxxxxxxxxx:test')
     >>> browser.open(
-    ...     'http://bugs.launchpad.test/debian/+source/mozilla-firefox/+bug/3')
+    ...     'http://bugs.launchpad.test/debian/+source/mozilla-firefox/+bug/'
+    ...     '3')
     >>> browser.getLink(url="+edit").click()
     >>> browser.url
     'http://bugs.launchpad.test/debian/+source/mozilla-firefox/+bug/3/+edit'
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-text-pages.txt b/lib/lp/bugs/stories/bugs/xx-bug-text-pages.txt
index 1e321f9..a09fca1 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-text-pages.txt
+++ b/lib/lp/bugs/stories/bugs/xx-bug-text-pages.txt
@@ -158,7 +158,8 @@ The comments are represented as a MIME message.
 
     >>> print(comments[3]['Content-Type'])
     text/plain; charset="utf-8"
-    >>> [(author_bytes, author_charset)] = decode_header(comments[3]['Author'])
+    >>> [(author_bytes, author_charset)] = decode_header(
+    ...     comments[3]['Author'])
     >>> print(author_bytes.decode(author_charset))
     Márk Shúttlewòrth (mark)
     >>> 'Date' in comments[3]
diff --git a/lib/lp/bugs/stories/bugs/xx-distribution-bugs-page.txt b/lib/lp/bugs/stories/bugs/xx-distribution-bugs-page.txt
index ef5e0be..0218048 100644
--- a/lib/lp/bugs/stories/bugs/xx-distribution-bugs-page.txt
+++ b/lib/lp/bugs/stories/bugs/xx-distribution-bugs-page.txt
@@ -7,7 +7,8 @@ information the bugs in it. It also displays the list of bugs.
     >>> anon_browser.open('http://bugs.launchpad.test/ubuntu/+bugs')
     >>> anon_browser.title
     'Bugs : Ubuntu'
-    >>> find_tags_by_class(anon_browser.contents, 'buglisting-row') is not None
+    >>> find_tags_by_class(
+    ...     anon_browser.contents, 'buglisting-row') is not None
     True
 
 The page has a link to see all open bugs.
@@ -15,7 +16,8 @@ The page has a link to see all open bugs.
     >>> anon_browser.getLink('Open bugs').click()
     >>> anon_browser.url
     'http://bugs.launchpad.test/ubuntu/+bugs'
-    >>> find_tags_by_class(anon_browser.contents, 'buglisting-row') is not None
+    >>> find_tags_by_class(
+    ...     anon_browser.contents, 'buglisting-row') is not None
     True
 
 It also has a link to subscribe to bug mail.
diff --git a/lib/lp/bugs/stories/bugs/xx-distrorelease-bugs-page.txt b/lib/lp/bugs/stories/bugs/xx-distrorelease-bugs-page.txt
index 5be0bc6..c265944 100644
--- a/lib/lp/bugs/stories/bugs/xx-distrorelease-bugs-page.txt
+++ b/lib/lp/bugs/stories/bugs/xx-distrorelease-bugs-page.txt
@@ -8,7 +8,8 @@ bugs, as well as a listing.
     >>> anon_browser.title
     'Warty (4.10) : Bugs : Ubuntu'
 
-    >>> find_tags_by_class(anon_browser.contents, 'buglisting-row') is not None
+    >>> find_tags_by_class(
+    ...     anon_browser.contents, 'buglisting-row') is not None
     True
 
 The page has a link to see all open bugs.
@@ -16,7 +17,8 @@ The page has a link to see all open bugs.
     >>> anon_browser.getLink('Open bugs').click()
     >>> anon_browser.url
     'http://bugs.launchpad.test/ubuntu/warty/+bugs'
-    >>> find_tags_by_class(anon_browser.contents, 'buglisting-row') is not None
+    >>> find_tags_by_class(
+    ...     anon_browser.contents, 'buglisting-row') is not None
     True
 
 It also has a link to subscribe to bug mail.
diff --git a/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt b/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt
index 8bbe996..0e43b2d 100644
--- a/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt
+++ b/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt
@@ -75,7 +75,8 @@ incomplete bugs without response.
     >>> user_browser.getControl(name='field.status:list').value = (
     ...     ['INCOMPLETE_WITH_RESPONSE'])
     >>> user_browser.getControl('Search', index=1).click()
-    >>> ('<a class="bugtitle" href="http://bugs.launchpad.test/jokosher/+bug/11";>' in
+    >>> ('<a class="bugtitle" '
+    ...  'href="http://bugs.launchpad.test/jokosher/+bug/11";>' in
     ...     find_tag_by_id(user_browser.contents, 'bugs-table-listing'))
     False
 
@@ -233,7 +234,8 @@ it is by default.  So we set the bug back to NEW.
     >>> logout()
 
     >>> user_browser.open(
-    ...     'http://bugs.launchpad.test/debian/+source/mozilla-firefox/+bug/8')
+    ...     'http://bugs.launchpad.test/debian/+source/mozilla-firefox/+bug/'
+    ...     '8')
     >>> user_browser.getControl('Status').value = ['Incomplete']
     >>> user_browser.getControl('Save Changes', index=0).click()
     >>> print(find_tag_by_id(user_browser.contents, 'can-expire'))
@@ -271,7 +273,8 @@ response) bugs.
     >>> user_browser.getControl(name='field.status:list').value = (
     ...     ['INCOMPLETE_WITHOUT_RESPONSE'])
     >>> user_browser.getControl('Search', index=1).click()
-    >>> ('<a class="bugtitle" href="http://bugs.launchpad.test/jokosher/+bug/11";>' in
+    >>> ('<a class="bugtitle" '
+    ...  'href="http://bugs.launchpad.test/jokosher/+bug/11";>' in
     ...     six.text_type(
     ...         find_tag_by_id(user_browser.contents, 'bugs-table-listing')))
     True
@@ -282,7 +285,8 @@ A default search turns that bug up as well.
     >>> user_browser.getControl('Search', index=0).click()
     >>> print(user_browser.url)
     http://bugs.launchpad.test/jokosher/+bugs?...&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE...
-    >>> ('<a class="bugtitle" href="http://bugs.launchpad.test/jokosher/+bug/11";>' in
+    >>> ('<a class="bugtitle" '
+    ...  'href="http://bugs.launchpad.test/jokosher/+bug/11";>' in
     ...     six.text_type(
     ...         find_tag_by_id(user_browser.contents, 'bugs-table-listing')))
     True
diff --git a/lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt b/lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt
index fdc8858..f1872c0 100644
--- a/lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt
+++ b/lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt
@@ -7,7 +7,8 @@ information the bugs in it. It also displays the list of bugs.
     >>> anon_browser.open('http://bugs.launchpad.test/firefox/+bugs')
     >>> anon_browser.title
     'Bugs : Mozilla Firefox'
-    >>> find_tags_by_class(anon_browser.contents, 'buglisting-row') is not None
+    >>> find_tags_by_class(
+    ...     anon_browser.contents, 'buglisting-row') is not None
     True
 
 The page has a link to see all open bugs.
@@ -15,7 +16,8 @@ The page has a link to see all open bugs.
     >>> anon_browser.getLink('Open bugs').click()
     >>> anon_browser.url
     'http://bugs.launchpad.test/firefox/+bugs'
-    >>> find_tags_by_class(anon_browser.contents, 'buglisting-row') is not None
+    >>> find_tags_by_class(
+    ...     anon_browser.contents, 'buglisting-row') is not None
     True
 
 It also has a link to subscribe to bug mail (which is implemented in
diff --git a/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt b/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt
index 59e338d..ba90510 100644
--- a/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt
+++ b/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt
@@ -65,7 +65,8 @@ The comment isn't synchronized immediately. To make that clear, we
 mark the comment as 'awaiting synchronization' until it makes its way
 to the remote bug tracker.
 
-    >>> activity = new_bug_comment.find(attrs={'class': 'boardCommentActivity'})
+    >>> activity = new_bug_comment.find(
+    ...     attrs={'class': 'boardCommentActivity'})
     >>> print(extract_text(activity.find_all('td')[1]))
     Awaiting synchronization
 
diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt b/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt
index fa1d699..4653df1 100644
--- a/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt
+++ b/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt
@@ -37,7 +37,8 @@ results when we use a valid assignee.
     >>> from lp.testing.service_usage_helpers import set_service_usage
     >>> set_service_usage('debian', bug_tracking_usage='LAUNCHPAD')
 
-    >>> anon_browser.open('http://bugs.launchpad.test/debian/+bugs?advanced=1')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/debian/+bugs?advanced=1')
     >>> anon_browser.getControl(name='field.assignee').value = 'name12'
     >>> anon_browser.getControl('Search', index=0).click()
     >>> print_bugtasks(anon_browser.contents)
@@ -52,7 +53,8 @@ results when we use a valid assignee.
 
 If we enter an invalid assignee, we'll get a nice error message.
 
-    >>> anon_browser.open('http://bugs.launchpad.test/ubuntu/+bugs?advanced=1')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/ubuntu/+bugs?advanced=1')
     >>> anon_browser.getControl(name='field.assignee').value = (
     ...     'invalid-assignee')
     >>> anon_browser.getControl('Search', index=0).click()
@@ -73,7 +75,8 @@ Searching by reporter
 
 Valid searches work:
 
-    >>> anon_browser.open('http://bugs.launchpad.test/debian/+bugs?advanced=1')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/debian/+bugs?advanced=1')
     >>> anon_browser.getControl(name='field.bug_reporter').value = 'name12'
     >>> anon_browser.getControl('Search', index=0).click()
     >>> print_bugtasks(anon_browser.contents)
@@ -89,7 +92,8 @@ Valid searches work:
 
 and invalid searches don't OOPS:
 
-    >>> anon_browser.open('http://bugs.launchpad.test/debian/+bugs?advanced=1')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/debian/+bugs?advanced=1')
     >>> anon_browser.getControl(name='field.bug_reporter').value = (
     ...     'invalid-reporter')
     >>> anon_browser.getControl('Search', index=0).click()
@@ -109,7 +113,8 @@ Searching for a bug commenter's bugs
 
 On the advanced search there's a field for specifying a bug commenter.
 
-    >>> anon_browser.open('http://bugs.launchpad.test/ubuntu/+bugs?advanced=1')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/ubuntu/+bugs?advanced=1')
     >>> anon_browser.getControl('Commenter') is not None
     True
 
@@ -144,7 +149,8 @@ Searching for a package subscriber's bugs
 On the advanced search there's a field for specifying a project,
 distribution, package, or series subscriber.
 
-    >>> anon_browser.open('http://bugs.launchpad.test/ubuntu/+bugs?advanced=1')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/ubuntu/+bugs?advanced=1')
     >>> anon_browser.getControl('Package or series subscriber') is not None
     True
 
diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt b/lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt
index 0e4e7af..c87f26a 100644
--- a/lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt
+++ b/lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt
@@ -32,7 +32,9 @@ Bug listings default to open bugtasks:
 
 But you can make it show fixed ones to:
 
-    >>> user_browser.open("http://launchpad.test/debian/+bugs?field.status=FIXRELEASED&search=Search";)
+    >>> user_browser.open(
+    ...     "http://launchpad.test/debian/+bugs";
+    ...     "?field.status=FIXRELEASED&search=Search")
     >>> print_bugtasks(user_browser.contents)
     8 Printing doesn't work mozilla-firefox (Debian) Medium Fix Released
 
@@ -79,7 +81,10 @@ View the distribution bug listing as Foo Bar, who's a maintainer.
 If inadvertently we copy and paste a newline character in the search
 text field, it'll be replaced by spaces and the search will work fine.
 
-    >>> user_browser.open('http://launchpad.test/ubuntu/+bugs?field.searchtext=blackhole%0D%0Atrash%0D%0Afolder&search=Search&orderby=-importance')
+    >>> user_browser.open(
+    ...     'http://launchpad.test/ubuntu/+bugs'
+    ...     '?field.searchtext=blackhole%0D%0Atrash%0D%0Afolder&search=Search'
+    ...     '&orderby=-importance')
     >>> user_browser.getControl(name='field.searchtext').value
     'blackhole trash folder'
     >>> print_bugtasks(user_browser.contents)
@@ -88,7 +93,13 @@ text field, it'll be replaced by spaces and the search will work fine.
 Do an advanced search with dupes turned on and find the duplicate in the
 results.
 
-    >>> anon_browser.open("""http://launchpad.test/firefox/+bugs?field.searchtext=&field.status%3Alist=New&field.status%3Alist=Confirmed&field.status-empty-marker=1&field.importance-empty-marker=1&field.assignee=&field.unassigned.used=&field.omit_dupes=&field.milestone-empty-marker=1&search=Search""";)
+    >>> anon_browser.open(
+    ...     "http://launchpad.test/firefox/+bugs";
+    ...     "?field.searchtext=&field.status%3Alist=New"
+    ...     "&field.status%3Alist=Confirmed&field.status-empty-marker=1"
+    ...     "&field.importance-empty-marker=1&field.assignee="
+    ...     "&field.unassigned.used=&field.omit_dupes="
+    ...     "&field.milestone-empty-marker=1&search=Search")
     >>> print_bugtasks(anon_browser.contents)
     5 Firefox install instructions should be complete
      Mozilla Firefox Critical New
@@ -106,13 +117,20 @@ Critical bugs
 A list of critical bugs reported in a given upstream can be viewed by
 clicking the "critical" quick search link. Debian has no open critical bugs:
 
-    >>> user_browser.open("http://launchpad.test/debian/+bugs?field.status%3Alist=New&field.status%3Alist=Confirmed&field.importance%3Alist=Critical&search=Search";)
+    >>> user_browser.open(
+    ...     "http://launchpad.test/debian/+bugs";
+    ...     "?field.status%3Alist=New&field.status%3Alist=Confirmed"
+    ...     "&field.importance%3Alist=Critical&search=Search")
     >>> print_bugtasks(user_browser.contents)
     <BLANKLINE>
 
 But Firefox has a fixed one that Foo Bar can see:
 
-    >>> admin_browser.open("http://launchpad.test/firefox/+bugs?search=Search&field.importance=Critical&field.status=New&field.status=Confirmed&field.status=In+Progress&field.status=Incomplete&field.status=Fix+Committed";)
+    >>> admin_browser.open(
+    ...     "http://launchpad.test/firefox/+bugs";
+    ...     "?search=Search&field.importance=Critical&field.status=New"
+    ...     "&field.status=Confirmed&field.status=In+Progress"
+    ...     "&field.status=Incomplete&field.status=Fix+Committed")
     >>> print_bugtasks(admin_browser.contents)
     5 Firefox install instructions should be complete
      Mozilla Firefox Critical New
@@ -124,13 +142,18 @@ My todo list
 The "my todo list" link gives the logged in user the ability to
 quickly see which bugs have been assigned to them.
 
-    >>> user_browser.open("http://launchpad.test/debian/+bugs?field.status%3Alist=New&field.status%3Alist=Confirmed&field.assignee=name12&search=Search";)
+    >>> user_browser.open(
+    ...     "http://launchpad.test/debian/+bugs";
+    ...     "?field.status%3Alist=New&field.status%3Alist=Confirmed"
+    ...     "&field.assignee=name12&search=Search")
     >>> print_bugtasks(user_browser.contents)
     2 Blackhole Trash folder mozilla-firefox (Debian) Low Confirmed
 
 This also works for upstream listings:
 
-    >>> user_browser.open("http://launchpad.test/firefox/+bugs?field.assignee=name12&search=Search";)
+    >>> user_browser.open(
+    ...     "http://launchpad.test/firefox/+bugs";
+    ...     "?field.assignee=name12&search=Search")
     >>> print_bugtasks(user_browser.contents)
     5 Firefox install instructions should be complete
      Mozilla Firefox Critical New
@@ -141,7 +164,13 @@ Looking at unassigned bugs
 
 View the unassigned bug tasks listing as user Sample Person.
 
-    >>> user_browser.open("""http://launchpad.test/firefox/+bugs?searchtext=&field.milestone-empty-marker=1&field.status%3Alist=New&field.status%3Alist=Confirmed&field.status-empty-marker=1&field.importance-empty-marker=1&assignee_option=none&field.assignee=&field.milestone-empty-marker=1&search=Search""";)
+    >>> user_browser.open(
+    ...     "http://launchpad.test/firefox/+bugs";
+    ...     "?searchtext=&field.milestone-empty-marker=1"
+    ...     "&field.status%3Alist=New&field.status%3Alist=Confirmed"
+    ...     "&field.status-empty-marker=1&field.importance-empty-marker=1"
+    ...     "&assignee_option=none&field.assignee="
+    ...     "&field.milestone-empty-marker=1&search=Search")
     >>> print_bugtasks(user_browser.contents)
     4 Reflow problems with complex page layouts
      Mozilla Firefox Medium New
@@ -181,7 +210,10 @@ Searching for simple strings
 The bugtask search facility supports searching on a simple text
 string.
 
-    >>> user_browser.open("http://launchpad.test/firefox/+bugs?field.searchtext=install&search=Search&advanced=&milestone=1&status=10&status=20&assignee=all";)
+    >>> user_browser.open(
+    ...     "http://launchpad.test/firefox/+bugs";
+    ...     "?field.searchtext=install&search=Search&advanced=&milestone=1"
+    ...     "&status=10&status=20&assignee=all")
     >>> print_bugtasks(user_browser.contents)
     5 Firefox install instructions should be complete
      Mozilla Firefox Critical New
@@ -191,7 +223,10 @@ string.
 If we search for something and get no matches, it'll say so in a meaningful
 way instead of displaying an empty table.
 
-    >>> user_browser.open("http://launchpad.test/firefox/+bugs?field.searchtext=fdsadsf&search=Search&advanced=&milestone=1&status=10&status=20&assignee=all";)
+    >>> user_browser.open(
+    ...     "http://launchpad.test/firefox/+bugs";
+    ...     "?field.searchtext=fdsadsf&search=Search&advanced=&milestone=1"
+    ...     "&status=10&status=20&assignee=all")
     >>> print(user_browser.contents)
     <...
     ...No results for search...
@@ -281,7 +316,10 @@ Bug heat in listings
 Bug listings display the bug heat in the last column. Heat is displayed
 as a number.
 
-    >>> user_browser.open("http://launchpad.test/firefox/+bugs?field.searchtext=install&search=Search&advanced=&milestone=1&status=10&status=20&assignee=all";)
+    >>> user_browser.open(
+    ...     "http://launchpad.test/firefox/+bugs";
+    ...     "?field.searchtext=install&search=Search&advanced=&milestone=1"
+    ...     "&status=10&status=20&assignee=all")
     >>> print_bugtasks(user_browser.contents, show_heat=True)
     5 Firefox install instructions should be complete
      Mozilla Firefox Critical New 0
diff --git a/lib/lp/bugs/stories/bugtracker/xx-bugtracker-remote-bug.txt b/lib/lp/bugs/stories/bugtracker/xx-bugtracker-remote-bug.txt
index 81fdee9..ecc169a 100644
--- a/lib/lp/bugs/stories/bugtracker/xx-bugtracker-remote-bug.txt
+++ b/lib/lp/bugs/stories/bugtracker/xx-bugtracker-remote-bug.txt
@@ -31,7 +31,8 @@ then a list of the relevant Launchpad bugs:
 If there is only a single bug watching the remote bug, then we skip
 the list page and redirect the user directly to that bug's page:
 
-    >>> browser.open('http://launchpad.test/bugs/bugtrackers/mozilla.org/2000')
+    >>> browser.open(
+    ...     'http://launchpad.test/bugs/bugtrackers/mozilla.org/2000')
     >>> print(browser.url)
     http://bugs.launchpad.test/firefox/+bug/1
 
@@ -39,7 +40,8 @@ If there are no bug watches for a particular remote bug, then a Not
 Found page is generated:
 
     >>> browser.handleErrors = True
-    >>> browser.open('http://launchpad.test/bugs/bugtrackers/mozilla.org/99999')
+    >>> browser.open(
+    ...     'http://launchpad.test/bugs/bugtrackers/mozilla.org/99999')
     Traceback (most recent call last):
     ...
     urllib.error.HTTPError: HTTP Error 404: Not Found
diff --git a/lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt b/lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt
index 1b20aef..edb5802 100644
--- a/lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt
+++ b/lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt
@@ -188,7 +188,8 @@ we'll get a nice error message.
 
 We can edit the details of the newly added bugtracker.
 
-    >>> user_browser.open('http://launchpad.test/bugs/bugtrackers/testmantis/')
+    >>> user_browser.open(
+    ...     'http://launchpad.test/bugs/bugtrackers/testmantis/')
     >>> user_browser.getLink('Change details').click()
 
     >>> user_browser.url
@@ -460,7 +461,8 @@ deleting bug watches en masse:
     >>> admin_browser.open(
     ...     'http://launchpad.test/bugs/bugtrackers/debbugs/+edit')
     >>> print(extract_text(find_tag_by_id(
-    ...     admin_browser.contents, 'bugtracker-delete-not-possible-reasons')))
+    ...     admin_browser.contents,
+    ...     'bugtracker-delete-not-possible-reasons')))
     Please note, this bug tracker cannot be deleted because:
       Bug comments have been imported via this bug tracker.
       This bug tracker is protected from deletion.
@@ -606,7 +608,8 @@ details are displayed. For example, when a bug watch is associated with
 a private bug:
 
     >>> admin_browser.open(
-    ...     'http://launchpad.test/debian/+source/mozilla-firefox/+bug/3/+secrecy')
+    ...     'http://launchpad.test/debian/+source/mozilla-firefox/+bug/3/'
+    ...     '+secrecy')
     >>> admin_browser.getControl('Private', index=1).selected = True
     >>> admin_browser.getControl('Change').click()
 
diff --git a/lib/lp/bugs/stories/bugwatches/xx-bugtask-bugwatch-linkage.txt b/lib/lp/bugs/stories/bugwatches/xx-bugtask-bugwatch-linkage.txt
index a3d31eb..5d36860 100644
--- a/lib/lp/bugs/stories/bugwatches/xx-bugtask-bugwatch-linkage.txt
+++ b/lib/lp/bugs/stories/bugwatches/xx-bugtask-bugwatch-linkage.txt
@@ -26,7 +26,8 @@ This means that we only display the status, it's not possible to edit it:
     <td><span class="statusConfirmed">Confirmed</span></td>
     ...
 
-    >>> status_control = browser.getControl(name='debian_mozilla-firefox.status')
+    >>> status_control = browser.getControl(
+    ...     name='debian_mozilla-firefox.status')
     Traceback (most recent call last):
     ...
     LookupError: name ...'debian_mozilla-firefox.status'
@@ -56,7 +57,8 @@ been reset to New.
     >>> browser.open(
     ...     'http://bugs.launchpad.test/debian/+source/mozilla-firefox/'
     ...     '+bug/1/+editstatus')
-    >>> status_control = browser.getControl(name='debian_mozilla-firefox.status')
+    >>> status_control = browser.getControl(
+    ...     name='debian_mozilla-firefox.status')
     >>> status_control.displayValue
     ['New']
 
@@ -72,7 +74,8 @@ Let's try to actually edit the status to see that it works:
     >>> browser.open(
     ...     'http://bugs.launchpad.test/debian/+source/mozilla-firefox/'
     ...     '+bug/1/+editstatus')
-    >>> status_control = browser.getControl(name='debian_mozilla-firefox.status')
+    >>> status_control = browser.getControl(
+    ...     name='debian_mozilla-firefox.status')
     >>> status_control.displayValue
     ['Invalid']
 
@@ -86,7 +89,8 @@ From the edit page we can also create a new bug watch:
     >>> url_control = browser.getControl(
     ...     name='debian_mozilla-firefox.url')
     >>> bugwatch_control.value = ['NEW']
-    >>> url_control.value = 'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1'
+    >>> url_control.value = (
+    ...     'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1')
 
     >>> submit_button = browser.getControl('Save Changes')
     >>> submit_button.click()
@@ -111,14 +115,16 @@ created, instead the old one will be used.
     >>> url_control = browser.getControl(
     ...     name='debian_mozilla-firefox.url')
     >>> bugwatch_control.value = ['NEW']
-    >>> url_control.value = 'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1'
+    >>> url_control.value = (
+    ...     'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1')
 
     >>> submit_button = browser.getControl('Save Changes')
     >>> submit_button.click()
     >>> browser.url
     'http://bugs.launchpad.test/debian/+source/mozilla-firefox/+bug/1'
 
-    >>> bugwatch_portlet = find_portlet(browser.contents, 'Remote bug watches')
+    >>> bugwatch_portlet = find_portlet(
+    ...     browser.contents, 'Remote bug watches')
     >>> for li_tag in bugwatch_portlet.find_all('li'):
     ...     print(li_tag.find_all('a')[0].string)
     mozilla.org #123543
diff --git a/lib/lp/bugs/stories/bugwatches/xx-bugwatch-errors.txt b/lib/lp/bugs/stories/bugwatches/xx-bugwatch-errors.txt
index 2501411..718e5f5 100644
--- a/lib/lp/bugs/stories/bugwatches/xx-bugwatch-errors.txt
+++ b/lib/lp/bugs/stories/bugwatches/xx-bugwatch-errors.txt
@@ -84,7 +84,8 @@ We can observe this for each of the BugWatchActivityStatus failure values:
     ...     value not in BUG_WATCH_ACTIVITY_SUCCESS_STATUSES]
     >>> for item in failure_values:
     ...     set_bugwatch_error_type(watch, item)
-    ...     user_browser.open('http://bugs.launchpad.test/thunderbird/+bug/12')
+    ...     user_browser.open(
+    ...         'http://bugs.launchpad.test/thunderbird/+bug/12')
     ...     for tag in find_tags_by_class(user_browser.contents,
     ...         'error message'):
     ...         print(extract_text(tag.decode_contents()))
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.txt b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.txt
index 52aa4ef..76b11a4 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.txt
+++ b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.txt
@@ -9,7 +9,8 @@ with a certain tag, for example the MOTUs wanting people to tag bugs
 that deal with new package request with a certain tag.
 
     >>> user_browser.open(
-    ...    'http://bugs.launchpad.test/ubuntu/+filebug?field.tags=new-package')
+    ...    'http://bugs.launchpad.test/ubuntu/+filebug'
+    ...    '?field.tags=new-package')
     >>> user_browser.getControl('Summary', index=0).value = (
     ...    'Please package CoolApp')
     >>> user_browser.getControl('Continue').click()
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-ubuntu-filebug.txt b/lib/lp/bugs/stories/guided-filebug/xx-ubuntu-filebug.txt
index 7e202d9..016aba6 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-ubuntu-filebug.txt
+++ b/lib/lp/bugs/stories/guided-filebug/xx-ubuntu-filebug.txt
@@ -40,7 +40,8 @@ filing view of another context.
 When filing bugs directly on source packages we are also not redirected.
 
     >>> admin_browser.open(
-    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+filebug')
+    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/'
+    ...     '+filebug')
     >>> print(admin_browser.url)
     http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+filebug
 
diff --git a/lib/lp/bugs/stories/patches-view/patches-view.txt b/lib/lp/bugs/stories/patches-view/patches-view.txt
index 6644208..d652311 100644
--- a/lib/lp/bugs/stories/patches-view/patches-view.txt
+++ b/lib/lp/bugs/stories/patches-view/patches-view.txt
@@ -61,7 +61,8 @@ still shows no patches.
     >>> with_anybody(factory.makeBugAttachment)(bug=bug_a, is_patch=False)
     <BugAttachment at...
     >>> transaction.commit()
-    >>> anon_browser.open('http://bugs.launchpad.test/patchy-product-1/+patches')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/patchy-product-1/+patches')
     >>> show_patches_view(anon_browser.contents)
     There are no patches associated with Patchy 1 at this time.
 
@@ -150,7 +151,8 @@ attachments, and various statuses...
 ...the youngest patch on each bug is visible in the patch report
 (except for bugs in "Fix Released" state, which aren't shown):
 
-    >>> anon_browser.open('http://bugs.launchpad.test/patchy-product-1/+patches')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/patchy-product-1/+patches')
     >>> show_patches_view(anon_browser.contents)
     Bug                                 Importance   Status    Patch Age
     Bug #...: bug_c title               Wishlist  Fix Committed ...second...
@@ -200,7 +202,9 @@ importance and status.
 
 But we can't sort by things that aren't validated by the view.
 
-    >>> anon_browser.open('http://bugs.launchpad.test/patchy-product-1/+patches?orderby=star-sign')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/patchy-product-1/+patches'
+    ...     '?orderby=star-sign')
     Traceback (most recent call last):
     ...
     lp.app.errors.UnexpectedFormData: Unexpected value for field 'orderby': 'star-sign'
@@ -252,7 +256,8 @@ Bugs in a product series show up in the patches view for that series.
     ...         target = ubuntu_distro.getSeries(target)
     ...     bugtask = factory.makeBugTask(bug=bug, target=target)
     ...     if importance is not None:
-    ...         bugtask.transitionToImportance(importance, ubuntu_distro.owner)
+    ...         bugtask.transitionToImportance(
+    ...             importance, ubuntu_distro.owner)
     ...     if status is not None:
     ...         bugtask.transitionToStatus(status, ubuntu_distro.owner)
     >>> login(ANONYMOUS)
diff --git a/lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt b/lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt
index b9285e4..ea5197c 100644
--- a/lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt
+++ b/lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt
@@ -41,7 +41,8 @@ And subscribe some people to the Firefox source package in ubuntu.
 Sample Person and the Landscape team are now subscribed.
 
     >>> browser.open(
-    ... 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+subscribe')
+    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/'
+    ...     '+subscribe')
     >>> print(backslashreplace(extract_text(find_portlet(
     ...     browser.contents, 'Subscribers'))))
     Subscribers
@@ -61,7 +62,8 @@ Sample Person can also unsubscribe themselves and the Landscape team.
     >>> subscribe_team.selected = False
     >>> browser.getControl('Save these changes').click()
     >>> browser.open(
-    ... 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+subscribe')
+    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/'
+    ...     '+subscribe')
     >>> print(extract_text(find_portlet(browser.contents, 'Subscribers')))
     Subscribers
       To all bugs in mozilla-firefox in Ubuntu:
@@ -95,7 +97,8 @@ The driver sees an extended form in the +subscribe view, which allows them
 to subscribe other people.
 
     >>> browser.open(
-    ... 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+subscribe')
+    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/'
+    ...     '+subscribe')
     >>> subscribe_other = browser.getControl('Subscribe someone else:')
     >>> subscribe_other.value = 'no-priv'
     >>> browser.getControl('Save these changes').click()
@@ -108,7 +111,8 @@ No Privileges Person is now subscribed...
     or changes a public bug in "mozilla-firefox in Ubuntu".
 
     >>> browser.open(
-    ... 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+subscribe')
+    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/'
+    ...     '+subscribe')
     >>> print(extract_text(find_portlet(browser.contents, 'Subscribers')))
     Subscribers
       To all bugs in mozilla-firefox in Ubuntu:
@@ -130,7 +134,8 @@ No Privileges Person is now subscribed...
     No Privileges Person will no longer automatically receive email about
     public bugs in "mozilla-firefox in Ubuntu".
     >>> browser.open(
-    ... 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+subscribe')
+    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/'
+    ...     '+subscribe')
     >>> print(extract_text(find_portlet(browser.contents, 'Subscribers')))
     Subscribers
       To all bugs in mozilla-firefox in Ubuntu:
@@ -171,7 +176,8 @@ purges the submitted form data from now unexpected values.
     >>> subscribe_other.value = 'nopriv'
     >>> browser.getControl('Save these changes').click()
     >>> browser.open(
-    ... 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+subscribe')
+    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/'
+    ...     '+subscribe')
     >>> print(extract_text(find_portlet(browser.contents, 'Subscribers')))
     Subscribers
       To all bugs in mozilla-firefox in Ubuntu:
@@ -183,7 +189,8 @@ When Sample Person now visits the bug subscription page, they no longer see
 the UI elements for the subscription/unsubscription of arbitrary persons.
 
     >>> browser.open(
-    ... 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+subscribe')
+    ...     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/'
+    ...     '+subscribe')
     >>> browser.getControl('Subscribe someone else:')
     Traceback (most recent call last):
     ...
diff --git a/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.txt b/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.txt
index adfcedf..248d7bd 100644
--- a/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.txt
+++ b/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.txt
@@ -96,7 +96,8 @@ view the page because they are an explicit subscriber on the bug.
 They now access the task page of a task on a private bug; also permitted.
 
     >>> browser = setupBrowser(auth="Basic foo.bar@xxxxxxxxxxxxx:test")
-    >>> browser.open("http://launchpad.test/firefox/+bug/%s/+editstatus"; % bug_id)
+    >>> browser.open(
+    ...     "http://launchpad.test/firefox/+bug/%s/+editstatus"; % bug_id)
     >>> print(browser.headers["Status"])
     200 Ok
 
diff --git a/lib/lp/bugs/stories/webservice/xx-bug.txt b/lib/lp/bugs/stories/webservice/xx-bug.txt
index 77ad62d..dcd2665 100644
--- a/lib/lp/bugs/stories/webservice/xx-bug.txt
+++ b/lib/lp/bugs/stories/webservice/xx-bug.txt
@@ -263,7 +263,8 @@ relation to some bug.
 
 Bug messages can be accessed anonymously.
 
-    >>> messages = anon_webservice.get("/bugs/5/messages").jsonBody()['entries']
+    >>> messages = anon_webservice.get(
+    ...     "/bugs/5/messages").jsonBody()['entries']
     >>> print(messages[0]['self_link'])
     http://.../firefox/+bug/5/comments/0
 
@@ -272,7 +273,8 @@ We can add a new message to a bug by calling the newMessage method.
     >>> print(webservice.named_post(
     ...     "/bugs/5", 'newMessage',
     ...     subject='A new message',
-    ...     content='This is a new message added through the webservice API.'))
+    ...     content=(
+    ...         'This is a new message added through the webservice API.')))
     HTTP/1.1 201 Created...
     Content-Length: 0
     ...
@@ -361,7 +363,8 @@ It's possible to change the task's assignee.
 
     >>> patch = {u'assignee_link': webservice.getAbsoluteUrl('/~cprov')}
     >>> bugtask_path = bug_one_bugtasks[0]['self_link']
-    >>> print(webservice.patch(bugtask_path, 'application/json', dumps(patch)))
+    >>> print(webservice.patch(
+    ...     bugtask_path, 'application/json', dumps(patch)))
     HTTP/1.1 209 Content Returned...
 
     >>> print(webservice.get(bugtask_path).jsonBody()['assignee_link'])
@@ -375,7 +378,8 @@ The task's importance can be modified directly.
     Low
 
     >>> patch = {u'importance': u'High'}
-    >>> print(webservice.patch(bugtask_path, 'application/json', dumps(patch)))
+    >>> print(webservice.patch(
+    ...     bugtask_path, 'application/json', dumps(patch)))
     HTTP/1.1 209 Content Returned...
 
     >>> body = webservice.get(bugtask_path).jsonBody()
@@ -399,7 +403,8 @@ The task's status can also be modified directly.
     Confirmed
 
     >>> patch = {u'status': u'Fix Committed'}
-    >>> print(webservice.patch(bugtask_path, 'application/json', dumps(patch)))
+    >>> print(webservice.patch(
+    ...     bugtask_path, 'application/json', dumps(patch)))
     HTTP/1.1 209 Content Returned...
 
     >>> print(webservice.get(bugtask_path).jsonBody()['status'])
@@ -415,7 +420,8 @@ If an error occurs during a request that sets both 'status' and
     High
 
     >>> patch = {u'importance': 'High', u'status': u'No Such Status'}
-    >>> print(webservice.patch(bugtask_path, 'application/json', dumps(patch)))
+    >>> print(webservice.patch(
+    ...     bugtask_path, 'application/json', dumps(patch)))
     HTTP/1.1 400 Bad Request...
 
     >>> task = webservice.get(bugtask_path).jsonBody()
@@ -431,7 +437,8 @@ The milestone can only be set by appropriately privileged users.
 
     >>> patch = {u'milestone_link': webservice.getAbsoluteUrl(
     ...                                 '/debian/+milestone/3.1')}
-    >>> print(webservice.patch(bugtask_path, 'application/json', dumps(patch)))
+    >>> print(webservice.patch(
+    ...     bugtask_path, 'application/json', dumps(patch)))
     HTTP/1.1 209 Content Returned...
 
     >>> print(webservice.get(bugtask_path).jsonBody()['milestone_link'])
@@ -865,7 +872,8 @@ Each subscription can be accessed individually.
 
 Subscriptions can also be accessed anonymously.
 
-    >>> subscriptions = anon_webservice.get(bug_one_subscriptions_url).jsonBody()
+    >>> subscriptions = anon_webservice.get(
+    ...     bug_one_subscriptions_url).jsonBody()
     >>> print(subscriptions['entries'][0]['self_link'])
     http://.../bugs/1/+subscription/stevea
 
diff --git a/lib/lp/buildmaster/doc/buildqueue.txt b/lib/lp/buildmaster/doc/buildqueue.txt
index f864ac2..6370c40 100644
--- a/lib/lp/buildmaster/doc/buildqueue.txt
+++ b/lib/lp/buildmaster/doc/buildqueue.txt
@@ -33,7 +33,9 @@ Instances returned by IBuildQueueSet provides the IBuildQueue interface:
 The IBuild record related to this job is provided by the 'build'
 attribute:
 
-    >>> from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet
+    >>> from lp.soyuz.interfaces.binarypackagebuild import (
+    ...     IBinaryPackageBuildSet,
+    ...     )
     >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq)
     >>> build.id
     8
diff --git a/lib/lp/buildmaster/stories/builder-views.txt b/lib/lp/buildmaster/stories/builder-views.txt
index 67d5ba3..d71e330 100644
--- a/lib/lp/buildmaster/stories/builder-views.txt
+++ b/lib/lp/buildmaster/stories/builder-views.txt
@@ -377,7 +377,8 @@ processor queue in the PPA category.
     >>> one_minute = datetime.timedelta(seconds=60)
     >>> any_failed_build.retry()
     >>> removeSecurityProxy(
-    ...     any_failed_build.buildqueue_record).estimated_duration = one_minute
+    ...     any_failed_build.buildqueue_record).estimated_duration = (
+    ...         one_minute)
     >>> transaction.commit()
     >>> login(ANONYMOUS)
 
diff --git a/lib/lp/code/doc/branch-merge-proposal-notifications.txt b/lib/lp/code/doc/branch-merge-proposal-notifications.txt
index 8ee0a56..d9b8dde 100644
--- a/lib/lp/code/doc/branch-merge-proposal-notifications.txt
+++ b/lib/lp/code/doc/branch-merge-proposal-notifications.txt
@@ -16,7 +16,9 @@ notification they would like to receive.
     ...     CodeReviewNotificationLevel)
     >>> from lp.code.interfaces.branchmergeproposal import (
     ...     IBranchMergeProposalJobSource)
-    >>> from lp.code.tests.helpers import make_merge_proposal_without_reviewers
+    >>> from lp.code.tests.helpers import (
+    ...     make_merge_proposal_without_reviewers,
+    ...     )
     >>> from lp.services.config import config
     >>> from lp.testing.dbuser import dbuser
     >>> from lp.testing.mail_helpers import pop_notifications
diff --git a/lib/lp/code/doc/revision.txt b/lib/lp/code/doc/revision.txt
index 054aa34..9244c72 100644
--- a/lib/lp/code/doc/revision.txt
+++ b/lib/lp/code/doc/revision.txt
@@ -119,7 +119,8 @@ sequence attribute is None.
     ...     BranchRevision, BranchRevision.branch == branch)
     >>> for branch_revision in sorted(ancestry,
     ...         key=lambda r: (
-    ...             0 if r.sequence is None else 1, r.sequence, r.revision.id),
+    ...             0 if r.sequence is None else 1, r.sequence,
+    ...             r.revision.id),
     ...         reverse=True):
     ...     print(branch_revision.sequence, branch_revision.revision.id)
     6 9
diff --git a/lib/lp/code/stories/branches/xx-branch-index.txt b/lib/lp/code/stories/branches/xx-branch-index.txt
index 2d03fcb..b066258 100644
--- a/lib/lp/code/stories/branches/xx-branch-index.txt
+++ b/lib/lp/code/stories/branches/xx-branch-index.txt
@@ -309,7 +309,8 @@ the branch.
 
     >>> browser = setupBrowser(auth="Basic test@xxxxxxxxxxxxx:test")
     >>> browser.open(
-    ...     'http://code.launchpad.test/~landscape-developers/landscape/trunk')
+    ...     'http://code.launchpad.test/~landscape-developers/landscape/'
+    ...     'trunk')
 
 
 Download URL
@@ -336,7 +337,8 @@ revisions. So we need to fake that here.
     >>> logout()
 
     >>> browser.open(
-    ...     'http://code.launchpad.test/~landscape-developers/landscape/trunk')
+    ...     'http://code.launchpad.test/~landscape-developers/landscape/'
+    ...     'trunk')
     >>> print(extract_text(find_tag_by_id(
     ...     browser.contents, 'branch-management')))
     Get this branch:
diff --git a/lib/lp/code/stories/branches/xx-branch-listings.txt b/lib/lp/code/stories/branches/xx-branch-listings.txt
index 7c49fba..3346713 100644
--- a/lib/lp/code/stories/branches/xx-branch-listings.txt
+++ b/lib/lp/code/stories/branches/xx-branch-listings.txt
@@ -148,7 +148,8 @@ Now all types of branches should be shown.
 Selecting an individual lifecycle status from the select control
 will cause only branches with that status to be listed.
 
-    >>> browser.getControl(name='field.lifecycle').displayValue = ['Abandoned']
+    >>> browser.getControl(name='field.lifecycle').displayValue = [
+    ...     'Abandoned']
     >>> browser.getControl('Filter').click()
     >>> table = find_tag_by_id(browser.contents, 'branchtable')
     >>> for row in table.tbody.find_all('tr'):
@@ -331,7 +332,8 @@ lifecycle ceases to be relevant, and the default is to sort by registrant.
 
 The implicitly sorted listings do not have an ordering widget at all.
 
-    >>> browser.open('http://code.launchpad.test/+recently-registered-branches')
+    >>> browser.open(
+    ...     'http://code.launchpad.test/+recently-registered-branches')
     >>> browser.getControl(name='field.sort_by').value
     Traceback (most recent call last):
     ...
@@ -455,7 +457,8 @@ subset of the branches are shown.
 Selecting an individual lifecycle status from the select control
 will cause only branches with that status to be listed.
 
-    >>> browser.getControl(name='field.lifecycle').displayValue = ['Experimental']
+    >>> browser.getControl(name='field.lifecycle').displayValue = [
+    ...     'Experimental']
     >>> browser.getControl('Filter').click()
     >>> table = find_tag_by_id(browser.contents, 'branchtable')
     >>> for row in table.tbody.find_all('tr'):
@@ -465,7 +468,8 @@ will cause only branches with that status to be listed.
 If the development focus matches the lifecycle selected, it is still shown
 first.
 
-    >>> browser.getControl(name='field.lifecycle').displayValue = ['Development']
+    >>> browser.getControl(name='field.lifecycle').displayValue = [
+    ...     'Development']
     >>> browser.getControl('Filter').click()
     >>> table = find_tag_by_id(browser.contents, 'branchtable')
     >>> for row in table.tbody.find_all('tr'):
diff --git a/lib/lp/code/stories/branches/xx-product-branches.txt b/lib/lp/code/stories/branches/xx-product-branches.txt
index 9ca90d2..f441561 100644
--- a/lib/lp/code/stories/branches/xx-product-branches.txt
+++ b/lib/lp/code/stories/branches/xx-product-branches.txt
@@ -297,7 +297,8 @@ of them are either merged or abandoned and there is no development focus
 branch, then they will not appear on the initial branch listing and
 the portlets will not be shown.
 
-    >>> admin_browser.open('http://code.launchpad.test/~carlos/iso-codes/0.35')
+    >>> admin_browser.open(
+    ...     'http://code.launchpad.test/~carlos/iso-codes/0.35')
     >>> admin_browser.getLink('Change branch details').click()
     >>> admin_browser.getControl('Abandoned').click()
     >>> admin_browser.getControl('Change Branch').click()
diff --git a/lib/lp/code/stories/branches/xx-upload-directions.txt b/lib/lp/code/stories/branches/xx-upload-directions.txt
index a530a21..4375a55 100644
--- a/lib/lp/code/stories/branches/xx-upload-directions.txt
+++ b/lib/lp/code/stories/branches/xx-upload-directions.txt
@@ -5,7 +5,8 @@ The branch ~name12/gnome-terminal/pushed is an upload branch. Its index page
 shows contextual directions on how to upload to it.
 
     >>> branch_page = (
-    ...     'http://code.launchpad.test/~name12/+branch/gnome-terminal/pushed')
+    ...     'http://code.launchpad.test/~name12/+branch/gnome-terminal/'
+    ...     'pushed')
 
 We will need multiple browsers, logged in with different users. Set them up
 now.
diff --git a/lib/lp/code/stories/codeimport/xx-create-codeimport.txt b/lib/lp/code/stories/codeimport/xx-create-codeimport.txt
index 9f338f0..78c03c8 100644
--- a/lib/lp/code/stories/codeimport/xx-create-codeimport.txt
+++ b/lib/lp/code/stories/codeimport/xx-create-codeimport.txt
@@ -77,7 +77,8 @@ for the import branch, and a Bazaar branch location.
 
 When the user clicks continue, the import branch is created
 
-    >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, "import-details")))
     Import Status: Reviewed
     This branch is an import of the Bazaar branch
     at http://bzr.example.com/firefox/trunk.
@@ -97,7 +98,8 @@ URL.
     ...     "http://user:password@xxxxxxxxxxxxxxx/firefox/trunk";)
     >>> browser.getControl('Project').value = "firefox"
     >>> browser.getControl('Request Import').click()
-    >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, "import-details")))
     Import Status: Reviewed
     This branch is an import of the Bazaar branch
     at http://user:password@xxxxxxxxxxxxxxx/firefox/trunk.
@@ -127,7 +129,8 @@ But a Launchpad Git URL is OK.
     >>> browser.getControl('Repo URL', index=0).value = (
     ...     "git://git.launchpad.net/firefox.git")
     >>> browser.getControl('Request Import').click()
-    >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, "import-details")))
     Import Status: Reviewed
     This branch is an import of the HEAD branch of the Git repository at
     git://git.launchpad.net/firefox.git.
@@ -150,7 +153,8 @@ a name for the import branch, and a subversion branch location.
 
 When the user clicks continue, the import branch is created
 
-    >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, "import-details")))
     Import Status: Reviewed
     This branch is an import of the Subversion branch
     from http://svn.example.com/firefox/trunk.
@@ -180,7 +184,8 @@ URL.
     ...     "http://user:password@xxxxxxxxxxxxxxx/firefox/trunk";)
     >>> browser.getControl('Project').value = "firefox"
     >>> browser.getControl('Request Import').click()
-    >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, "import-details")))
     Import Status: Reviewed
     This branch is an import of the Subversion branch
     from http://user:password@xxxxxxxxxxxxxxx/firefox/trunk.
@@ -205,7 +210,8 @@ a name for the import branch, and a Git repository location.
 
 When the user clicks continue, the approved import branch is created.
 
-    >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, "import-details")))
     Import Status: Reviewed
     This branch is an import of the HEAD branch of the Git repository at
     git://example.com/firefox.git.
@@ -234,7 +240,8 @@ allowed to match that of an existing Bazaar-targeted import.
 
 When the user clicks continue, the approved import repository is created.
 
-    >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, "import-details")))
     Import Status: Reviewed
     This repository is an import of the Git repository at
     git://example.com/firefox.git.
@@ -257,7 +264,8 @@ to identify the CVS branch.  A project and branch name are also required.
     >>> browser.getControl('Module').value = "firefox"
     >>> browser.getControl('Request Import').click()
 
-    >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, "import-details")))
     Import Status: Reviewed
     This branch is an import of the CVS module firefox from
     :pserver:anonymous@xxxxxxxxxxxxxxx:/mozilla/cvs.
diff --git a/lib/lp/code/stories/feeds/xx-branch-atom.txt b/lib/lp/code/stories/feeds/xx-branch-atom.txt
index a8dbcb0..45e545c 100644
--- a/lib/lp/code/stories/feeds/xx-branch-atom.txt
+++ b/lib/lp/code/stories/feeds/xx-branch-atom.txt
@@ -27,7 +27,8 @@ Create some specific branches to use for this test
     ...         owner=owner, date_created=next(date_generator))
     >>> mike = factory.makePerson(name='mike', displayname='Mike Murphy')
     >>> mary = factory.makePerson(name='mary', displayname='Mary Murphy')
-    >>> projectgroup = factory.makeProject(name='oh-man', displayname='Oh Man')
+    >>> projectgroup = factory.makeProject(
+    ...     name='oh-man', displayname='Oh Man')
     >>> product1 = factory.makeProduct(
     ...     name='fooix', projectgroup=projectgroup, displayname="Fooix")
     >>> product2 = factory.makeProduct(
@@ -128,7 +129,8 @@ developers team has two branches which are both private.
 If we look at the feed for landscape developers there will be no
 branches listed, just an id for the feed.
 
-    >>> browser.open('http://feeds.launchpad.test/~landscape-developers/branches.atom')
+    >>> browser.open(
+    ...     'http://feeds.launchpad.test/~landscape-developers/branches.atom')
     >>> _ = feedparser.parse(browser.contents)
     >>> for element in BeautifulSoup(browser.contents, 'xml').title.contents:
     ...     print(element)
@@ -214,7 +216,9 @@ Feed for a single branch
 A single branch can have an Atom feed with each revision being a
 different entry.
 
-    >>> url = 'http://feeds.launchpad.test/~mark/firefox/release--0.9.1/branch.atom'
+    >>> url = (
+    ...     'http://feeds.launchpad.test/~mark/firefox/release--0.9.1/'
+    ...     'branch.atom')
     >>> browser.open(url)
     >>> _ = feedparser.parse(browser.contents)
     >>> for element in BeautifulSoup(browser.contents, 'xml').title.contents:
diff --git a/lib/lp/code/stories/webservice/xx-branch-links.txt b/lib/lp/code/stories/webservice/xx-branch-links.txt
index dfeec6e..67fd9f1 100644
--- a/lib/lp/code/stories/webservice/xx-branch-links.txt
+++ b/lib/lp/code/stories/webservice/xx-branch-links.txt
@@ -70,7 +70,8 @@ If it turns out that the branch has no connection with the spec, it can be
 unlinked from the spec as well.
 
     >>> _unused = webservice.named_post(
-    ...     robots['self_link'], 'unlinkSpecification', spec=spec['self_link'])
+    ...     robots['self_link'], 'unlinkSpecification',
+    ...     spec=spec['self_link'])
     >>> spec_links = webservice.get(
     ...     robots['spec_links_collection_link']).jsonBody()
     >>> print(len(spec_links['entries']))
diff --git a/lib/lp/registry/browser/tests/gpg-views.txt b/lib/lp/registry/browser/tests/gpg-views.txt
index dcb4257..e76f550 100644
--- a/lib/lp/registry/browser/tests/gpg-views.txt
+++ b/lib/lp/registry/browser/tests/gpg-views.txt
@@ -22,9 +22,10 @@ Set up some fingerprints for testing:
     >>> malformed   = "XXXX"
     >>> bogus       = "1111 1111 1111 1111 1111  1111 1111 1111 1111 1111"
     >>> gpgv3       = "11 28 37 E2 CB 46 72 67  9E 8E 22 18 DA F9 C0 96"
-    >>> with_crap   = ("CFDD 0231 D4A8 992D C760 F5B3 E0B4 E659 E389 E544 uid "
-    ...                "S\xe9bastien Serre (Bienvenue sous Ubuntu) "
-    ...                "<sebastien.serre@xxxxxxxxx> sub 1024g/F39C8D42 2006-08-17")
+    >>> with_crap   = (
+    ...     "CFDD 0231 D4A8 992D C760 F5B3 E0B4 E659 E389 E544 uid "
+    ...     "S\xe9bastien Serre (Bienvenue sous Ubuntu) "
+    ...     "<sebastien.serre@xxxxxxxxx> sub 1024g/F39C8D42 2006-08-17")
     >>> revoked     = "84D2 05F0 3E1E 6709 6CB5  4E26 2BE8 3793 AACC D97C"
     >>> expired     = "0DD6 4D28 E5F4 1138 5334  9520 0E3D B4D4 02F5 3CC6"
 
@@ -34,7 +35,8 @@ Set up some fingerprints for testing:
     ...         'action': action,
     ...         'import': 'Import Key'})
     ...     request.method = "POST"
-    ...     view = getMultiAdapter((sample_user, request), name="+editpgpkeys")
+    ...     view = getMultiAdapter(
+    ...         (sample_user, request), name="+editpgpkeys")
     ...     view.form_action()
     ...     return view
 
diff --git a/lib/lp/registry/browser/tests/productrelease-views.txt b/lib/lp/registry/browser/tests/productrelease-views.txt
index fb28f23..b60d1a2 100644
--- a/lib/lp/registry/browser/tests/productrelease-views.txt
+++ b/lib/lp/registry/browser/tests/productrelease-views.txt
@@ -44,7 +44,8 @@ milestone.
     ...     'field.actions.create': 'Create release',
     ...     'field.keep_milestone_active.used': '', # false
     ...     }
-    >>> view = create_initialized_view(naked_milestone, '+addrelease', form=form)
+    >>> view = create_initialized_view(
+    ...     naked_milestone, '+addrelease', form=form)
     >>> print(view.errors)
     []
 
@@ -55,14 +56,16 @@ milestone.
     False
 
     >>> for release in series.releases:
-    ...     print(release.version, release.release_notes, release.datereleased)
+    ...     print(
+    ...         release.version, release.release_notes, release.datereleased)
     0.1 Initial release. 2007-05-11 00:00:00+00:00
 
     >>> transaction.commit()
 
 Only one release can be created for the milestone.
 
-    >>> view = create_initialized_view(naked_milestone, '+addrelease', form=form)
+    >>> view = create_initialized_view(
+    ...     naked_milestone, '+addrelease', form=form)
     >>> for notice in view.request.response.notifications:
     ...     print(notice.message)
     A project release already exists for this milestone.
diff --git a/lib/lp/registry/doc/announcement.txt b/lib/lp/registry/doc/announcement.txt
index e916ec3..936a90a 100644
--- a/lib/lp/registry/doc/announcement.txt
+++ b/lib/lp/registry/doc/announcement.txt
@@ -61,8 +61,9 @@ publication:
     ...  mark,
     ...  "Last Call for OSSummit Asia CFP",
     ...  summary="""For all those procrastinating submitting talks and
-    ...  tutorials for OS Summit Asia, here's your friendly reminder!  The call
-    ...  for papers ends this week, so please submit your proposals promptly.""",
+    ...  tutorials for OS Summit Asia, here's your friendly reminder!  The
+    ...  call for papers ends this week, so please submit your proposals
+    ...  promptly.""",
     ...  url="http://www.mail-archive.com/announce@xxxxxxxxxx/msg00367.html";,
     ...  publication_date=None)
 
@@ -86,9 +87,9 @@ And we can also force immediate publication of the announcement:
     ...  immediate availability of version 1.2.25 of the Apache Tomcat
     ...  Connectors.
     ...
-    ...  It contains connectors, which allow a web server such as Apache HTTPD,
-    ...  Microsoft IIS and Sun Web Server to act as a front end to the Tomcat
-    ...  web application server.""",
+    ...  It contains connectors, which allow a web server such as Apache
+    ...  HTTPD, Microsoft IIS and Sun Web Server to act as a front end to the
+    ...  Tomcat web application server.""",
     ...  publication_date=NOW)
 
 And we can set a date in the future for publishing too:
diff --git a/lib/lp/registry/doc/distribution-mirror.txt b/lib/lp/registry/doc/distribution-mirror.txt
index 0b39afc..1249ad7 100644
--- a/lib/lp/registry/doc/distribution-mirror.txt
+++ b/lib/lp/registry/doc/distribution-mirror.txt
@@ -153,7 +153,9 @@ We also have a property which returns all unofficial mirrors.
 It's possible to retrieve a mirror by its name:
 
     >>> from lp.testing import verifyObject
-    >>> from lp.registry.interfaces.distributionmirror import IDistributionMirror
+    >>> from lp.registry.interfaces.distributionmirror import (
+    ...     IDistributionMirror,
+    ...     )
     >>> example_mirror = mirrorset.getByName('archive-mirror')
     >>> verifyObject(IDistributionMirror, example_mirror)
     True
@@ -950,7 +952,8 @@ tracked in Launchpad.
     ...     http_url="http://mirror.davis.antarctica.org/ubuntu";,
     ...     official_candidate=True)
     >>> de_archive_mirror.status = MirrorStatus.OFFICIAL
-    >>> de_archive_prober_log = factory.makeMirrorProbeRecord(de_archive_mirror)
+    >>> de_archive_prober_log = factory.makeMirrorProbeRecord(
+    ...     de_archive_mirror)
 
 Normal users can access country_dns_mirror, can see if a mirror is eligible
 for the status, however, they may not change it:
diff --git a/lib/lp/registry/doc/distribution-sourcepackage.txt b/lib/lp/registry/doc/distribution-sourcepackage.txt
index a93253b..5b6a88d 100644
--- a/lib/lp/registry/doc/distribution-sourcepackage.txt
+++ b/lib/lp/registry/doc/distribution-sourcepackage.txt
@@ -18,7 +18,9 @@ distribution object:
     >>> from zope.component import getUtility
     >>> from lp.testing import verifyObject
     >>> from lp.registry.interfaces.distribution import IDistributionSet
-    >>> from lp.registry.interfaces.distributionsourcepackage import IDistributionSourcePackage
+    >>> from lp.registry.interfaces.distributionsourcepackage import (
+    ...     IDistributionSourcePackage,
+    ...     )
     >>> debian = getUtility(IDistributionSet).getByName("debian")
     >>> ubuntu = getUtility(IDistributionSet).getByName("ubuntu")
 
@@ -115,9 +117,9 @@ release.
     ...     status=PackagePublishingStatus.PUBLISHED, component='main',
     ...     pocket=PackagePublishingPocket.RELEASE)
     >>> firefox_publication_hoary = publisher.getPubSource(
-    ...     sourcename='firefox', version='0.01-1ubuntu1.1', distroseries=hoary,
-    ...     status=PackagePublishingStatus.PUBLISHED, component='main',
-    ...     pocket=PackagePublishingPocket.SECURITY)
+    ...     sourcename='firefox', version='0.01-1ubuntu1.1',
+    ...     distroseries=hoary, status=PackagePublishingStatus.PUBLISHED,
+    ...     component='main', pocket=PackagePublishingPocket.SECURITY)
     >>> firefox = ubuntu.getSourcePackage('firefox')
     >>> print(firefox.latest_overall_publication.pocket.name)
     SECURITY
diff --git a/lib/lp/registry/doc/distroseries.txt b/lib/lp/registry/doc/distroseries.txt
index 225c66d..7d202f5 100644
--- a/lib/lp/registry/doc/distroseries.txt
+++ b/lib/lp/registry/doc/distroseries.txt
@@ -358,7 +358,8 @@ getBinariesForSeries() should be inherited from parent release.
     >>> bumpy_firefox_sp.currentrelease.getBinariesForSeries(bumpy).count()
     3
 
-    >>> for bin in bumpy_firefox_sp.currentrelease.getBinariesForSeries(bumpy):
+    >>> for bin in bumpy_firefox_sp.currentrelease.getBinariesForSeries(
+    ...         bumpy):
     ...     print(bin.id, bin.title, bin.build.distro_arch_series.title)
     27 mozilla-firefox-data-0.9 The Warty Warthog Release for i386 (386)
     26 mozilla-firefox-0.9 The Warty Warthog Release for hppa (hppa)
diff --git a/lib/lp/registry/doc/pillar.txt b/lib/lp/registry/doc/pillar.txt
index a471c21..400e32c 100644
--- a/lib/lp/registry/doc/pillar.txt
+++ b/lib/lp/registry/doc/pillar.txt
@@ -199,7 +199,8 @@ Distributions.
 
     >>> from lp.app.enums import InformationType
     >>> factory.makeProduct(
-    ...     name='ubuntu-sekrit', information_type=InformationType.PROPRIETARY)
+    ...     name='ubuntu-sekrit',
+    ...     information_type=InformationType.PROPRIETARY)
     <Product ...>
     >>> for row in pillar_set.search(
     ...         getUtility(ILaunchBag).user, 'ubuntu', limit=6):
diff --git a/lib/lp/registry/doc/teammembership.txt b/lib/lp/registry/doc/teammembership.txt
index e55a1d6..db00a59 100644
--- a/lib/lp/registry/doc/teammembership.txt
+++ b/lib/lp/registry/doc/teammembership.txt
@@ -785,7 +785,8 @@ And you can check which direct memberships a team has by using
 member_memberships:
 
     >>> for membership in t3.member_memberships:
-    ...     print('%s: %s' % (membership.person.name, membership.status.title))
+    ...     print('%s: %s' %
+    ...           (membership.person.name, membership.status.title))
     cprov: Approved
     jdub: Administrator
 
diff --git a/lib/lp/registry/doc/vocabularies.txt b/lib/lp/registry/doc/vocabularies.txt
index 9bc4dc0..3f271c4 100644
--- a/lib/lp/registry/doc/vocabularies.txt
+++ b/lib/lp/registry/doc/vocabularies.txt
@@ -716,7 +716,8 @@ Valid teams do not include teams that have been merged.
     >>> from lp.registry.personmerge import merge_people
     >>> ignored = login_person(foo_bar)
     >>> registry_experts = getUtility(ILaunchpadCelebrities).registry_experts
-    >>> merge_people(ephemeral, registry_experts, reviewer=ephemeral.teamowner)
+    >>> merge_people(
+    ...     ephemeral, registry_experts, reviewer=ephemeral.teamowner)
     >>> ignored = login_person(sample_person)
     >>> for person in sorted(vocab.search('team'), key=attrgetter('name')):
     ...     print(person.name)
diff --git a/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt b/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt
index 48068d4..b5132c9 100644
--- a/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt
+++ b/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt
@@ -23,7 +23,8 @@ on their status and content.
     ...             # from different countries, so we'll just skip it.
     ...             pass
     ...         else:
-    ...             tds = tuple([extract_text(td) for td in tr.find_all('td')])
+    ...             tds = tuple(
+    ...                 [extract_text(td) for td in tr.find_all('td')])
     ...             mirrors.append(tds)
 
 Official mirrors
@@ -89,7 +90,8 @@ seen by distro owners, mirror admins of the distro or launchpad admins.
     >>> browser.url
     'http://launchpad.test/ubuntu/+disabledmirrors'
 
-    >>> print(find_tag_by_id(browser.contents, 'maincontent').decode_contents())
+    >>> print(find_tag_by_id(
+    ...     browser.contents, 'maincontent').decode_contents())
     <BLANKLINE>
     ...We don't know of any Disabled Mirrors for this distribution...
 
@@ -123,7 +125,8 @@ looked at yet.  Since all pending mirrors are grouped on one page the
 type of mirror is shown.  Also the freshness is not visible since
 pending mirrors have never been probed.
 
-    >>> user_browser.open('http://launchpad.test/ubuntu/+pendingreviewmirrors')
+    >>> user_browser.open(
+    ...     'http://launchpad.test/ubuntu/+pendingreviewmirrors')
     Traceback (most recent call last):
     ...
     zope.security.interfaces.Unauthorized: ...
diff --git a/lib/lp/registry/stories/mailinglists/lifecycle.txt b/lib/lp/registry/stories/mailinglists/lifecycle.txt
index 63d2ff6..1d7797e 100644
--- a/lib/lp/registry/stories/mailinglists/lifecycle.txt
+++ b/lib/lp/registry/stories/mailinglists/lifecycle.txt
@@ -94,8 +94,8 @@ address.
     >>> from lp.testing.pages import strip_label
 
     >>> browser.getLink(url='+mailinglist').click()
-    >>> print(extract_text(find_tag_by_id(browser.contents,
-    ...                                   'mailing_list_not_contact_address')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, 'mailing_list_not_contact_address')))
     The mailing list is not set as the team contact address. You can
     set it.
 
@@ -120,8 +120,8 @@ list configuration screen displays a message to this effect.
     >>> browser.getControl('Change').click()
 
     >>> browser.getLink(url='+mailinglist').click()
-    >>> print(extract_text(find_tag_by_id(browser.contents,
-    ...                                   'mailing_list_not_contact_address')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     browser.contents, 'mailing_list_not_contact_address')))
     The mailing list is not set as the team contact address. You can
     set it.
 
diff --git a/lib/lp/registry/stories/mailinglists/subscriptions.txt b/lib/lp/registry/stories/mailinglists/subscriptions.txt
index 525698e..0dd4b3e 100644
--- a/lib/lp/registry/stories/mailinglists/subscriptions.txt
+++ b/lib/lp/registry/stories/mailinglists/subscriptions.txt
@@ -69,7 +69,8 @@ Any team member can join the mailing list.
     >>> logout()
     >>> no_team_browser = setupBrowserFreshLogin(person)
 
-    >>> no_team_browser.open('http://launchpad.test/people/+me/+editmailinglists')
+    >>> no_team_browser.open(
+    ...     'http://launchpad.test/people/+me/+editmailinglists')
     >>> rosetta_admins = no_team_browser.getControl(
     ...     name='field.subscription.rosetta-admins')
     >>> rosetta_admins.displayOptions
diff --git a/lib/lp/registry/stories/milestone/xx-milestone-description.txt b/lib/lp/registry/stories/milestone/xx-milestone-description.txt
index 7f1745f..4fadbbc 100644
--- a/lib/lp/registry/stories/milestone/xx-milestone-description.txt
+++ b/lib/lp/registry/stories/milestone/xx-milestone-description.txt
@@ -28,7 +28,8 @@ We can set the summary while creating a milestone for a Distribution.
 
 The summary appears on the milestone index page.
 
-    >>> test_browser.open('http://launchpad.test/ubuntu/+milestone/milestone1')
+    >>> test_browser.open(
+    ...     'http://launchpad.test/ubuntu/+milestone/milestone1')
     >>> tag = find_tag_by_id(test_browser.contents, 'description')
     >>> print(extract_text(tag))
     Summary of first Ubuntu milestone.
@@ -43,7 +44,8 @@ We can edit the summary after creating the milestone.
 
 And see that it is indeed modified on the milestone page.
 
-    >>> test_browser.open('http://launchpad.test/ubuntu/+milestone/milestone1')
+    >>> test_browser.open(
+    ...     'http://launchpad.test/ubuntu/+milestone/milestone1')
     >>> tag = find_tag_by_id(test_browser.contents, 'description')
     >>> print(extract_text(tag))
     Modified summary of first Ubuntu milestone.
diff --git a/lib/lp/registry/stories/object/xx-nameblacklist.txt b/lib/lp/registry/stories/object/xx-nameblacklist.txt
index c547394..737e702 100644
--- a/lib/lp/registry/stories/object/xx-nameblacklist.txt
+++ b/lib/lp/registry/stories/object/xx-nameblacklist.txt
@@ -10,7 +10,8 @@ Try creating a project with a blacklisted name:
     >>> admin_browser.getControl('Project Group Summary').value = 'Whatever'
     >>> admin_browser.getControl('Description').value = 'Whatever'
     >>> admin_browser.getControl('Add').click()
-    >>> "The name &#x27;blacklisted&#x27; has been blocked" in admin_browser.contents
+    >>> ("The name &#x27;blacklisted&#x27; has been blocked" in
+    ...  admin_browser.contents)
     True
 
 Try renaming a project to a blacklisted name:
@@ -19,7 +20,8 @@ Try renaming a project to a blacklisted name:
     >>> admin_browser.getLink('Administer').click()
     >>> admin_browser.getControl('Name', index=0).value = 'blacklisted'
     >>> admin_browser.getControl('Change Details').click()
-    >>> "The name &#x27;blacklisted&#x27; has been blocked" in admin_browser.contents
+    >>> ("The name &#x27;blacklisted&#x27; has been blocked" in
+    ...  admin_browser.contents)
     True
 
 Same behaviour for products:
@@ -28,7 +30,8 @@ Same behaviour for products:
     >>> admin_browser.getLink('Administer').click()
     >>> admin_browser.getControl('Name').value = 'blacklisted'
     >>> admin_browser.getControl('Change').click()
-    >>> "The name &#x27;blacklisted&#x27; has been blocked" in admin_browser.contents
+    >>> ("The name &#x27;blacklisted&#x27; has been blocked"
+    ...  in admin_browser.contents)
     True
 
 Same behaviour for people:
@@ -37,7 +40,8 @@ Same behaviour for people:
     >>> admin_browser.getLink('Change details').click()
     >>> admin_browser.getControl('Name', index=1).value = 'admin42'
     >>> admin_browser.getControl('Save').click()
-    >>> "The name &#x27;admin42&#x27; has been blocked" in admin_browser.contents
+    >>> ("The name &#x27;admin42&#x27; has been blocked" in
+    ...  admin_browser.contents)
     True
 
 Note that it is possible to have an object with a blacklisted name. These
diff --git a/lib/lp/registry/stories/person/xx-add-sshkey.txt b/lib/lp/registry/stories/person/xx-add-sshkey.txt
index 8283d4f..c58405f 100644
--- a/lib/lp/registry/stories/person/xx-add-sshkey.txt
+++ b/lib/lp/registry/stories/person/xx-add-sshkey.txt
@@ -86,7 +86,14 @@ message will be shown.
 Now, Salgado will upload one of each type of key, matching the expected
 format.
 
-    >>> sshkey = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6VVQrIoBhxSB7duD69PRzYfdJz3QNUky5lSOpl6a9hEP9iAU72RK3fr4uaYiEEjr70EDAROCimi/rtkBuWCRmPJbQDpzBoZ7PDW/jF5tWAuC4+5z/fy05HOhHRH8WGzeEuWn5HBflcx1QasMD95oDiiEuQbF/kGxBM5/no/4FeJU3fgc+1XQNH7tMDQIcaqoHarc2kefGC8/sbRwbzajhg9yeqskgs6o6y+7931/bcZSLZ/wU53m5nB7eVkkVihk7KD+sf9jKG91LnaRW1IjBgo8AAbXl+e556XkwIwVoieKNYW2Fvw8ybcW5rCTvJ1e/3Cvo2hw8ZsDMRofSifiKw== salgado@canario"
+    >>> sshkey = (
+    ...     "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6VVQrIoBhxSB7duD69PRzYfdJz3Q"
+    ...     "NUky5lSOpl6a9hEP9iAU72RK3fr4uaYiEEjr70EDAROCimi/rtkBuWCRmPJbQDpz"
+    ...     "BoZ7PDW/jF5tWAuC4+5z/fy05HOhHRH8WGzeEuWn5HBflcx1QasMD95oDiiEuQbF"
+    ...     "/kGxBM5/no/4FeJU3fgc+1XQNH7tMDQIcaqoHarc2kefGC8/sbRwbzajhg9yeqsk"
+    ...     "gs6o6y+7931/bcZSLZ/wU53m5nB7eVkkVihk7KD+sf9jKG91LnaRW1IjBgo8AAbX"
+    ...     "l+e556XkwIwVoieKNYW2Fvw8ybcW5rCTvJ1e/3Cvo2hw8ZsDMRofSifiKw== "
+    ...     "salgado@canario")
     >>> browser.getControl(name='sshkey').value = sshkey
     >>> browser.getControl('Import Public Key').click()
     >>> soup = find_main_content(browser.contents)
@@ -94,7 +101,25 @@ format.
     ...     print(tag.decode_contents())
     SSH public key added.
 
-    >>> sshkey = "ssh-dss AAAAB3NzaC1kc3MAAAEBAObOoy3fScSSQPHE/V6tPGoFzo5y1JRjDLcs8CNcvIHh9L27Qdj6h18AXn6MUCvvSCKm49aHpp1Xe14a6fmEIesjz6VopPWGENaOwRmhH6zfqM6imKUXQ0sq9p0znYb0TMjyRC0/AmqYneUF6FA2mVXygkGAkp/vDRPFQhPwnHpVD9TVPxHBQdHgM3bTo2TT+GoL7kw/s32ZiAH4OPvN5fN7bCkQWoUs/ySfoNbISMdvdtq07Rra2Biwzgjjs0ZcKbMicbDyYCe4gXlqK4wqcDfcwgrdqdG6NM0LUdekarWjnv0pMb6ttUl4U7e7Nf+eGkiTVItlppC8DyrnqC9SKCUAAAAVAOlEYNobJottyObVWQcrU8eAP4T5AAABAQDmJmL4DcQ1GVvw1Pjy57V0WUyGrOVBRVz7BwYBIvMA7xJCCvzd47mYWrWJkjV6O3tw2vG5oZx+BXE+ve8O6jL89CrwqncoUS8WHCojRmuUHTmtCCiRBCH+/68HMCusO3Blk//kQSsaqfIn+8Xa56Vr2SweSUlLgjvb51+89JJ13oDlUvdftW2GZu+grbmojqcoJ1LVAI5n0qsDItsFid46f8XfNzPeksasY9JbY5fKq/xf1KcgXL2F9XwmrDjFCuI4/xkJWNfGwaLKC/cbrJ1xmvPLl1/Hm5kNqgrwpNwHVOwyYSCUqXroU5PnpE9uydHUhjhtU2K2Hj0i7fOyxoxyAAABAQCpXKgd6lpTAEKm7ECY3TbJaTXPkNvAwg/2ud+PrtefHrVFFWrXrblSQhnmnc6ut8G3BsDzCljAIV2v+XcdOo+m8EViLf+Bi+gfbAIz4vdVepwQ2XHWUOTKk90i7Xqg4mUUDRIVw9ioNF0GAHbNlJTK3FWC3gstbCJU2hyV3UzgB95b6zqpUHeyn1RK4VAFYGY9fCIdZNy926HEart6uO/N6cO1ETw5B63kI8fTBjU7HLGgGXRjOv1APAqvKgry3tQD2WYkVJGRyYLjDK9d8nStUpwN5swI1xx2IWAbD+UCsRXAixn8s3mvpBD/jbnWjrzEensBc96jtiAsx2P5oXEd salgado@canario"
+    >>> sshkey = (
+    ...     "ssh-dss AAAAB3NzaC1kc3MAAAEBAObOoy3fScSSQPHE/V6tPGoFzo5y1JRjDLcs"
+    ...     "8CNcvIHh9L27Qdj6h18AXn6MUCvvSCKm49aHpp1Xe14a6fmEIesjz6VopPWGENaO"
+    ...     "wRmhH6zfqM6imKUXQ0sq9p0znYb0TMjyRC0/AmqYneUF6FA2mVXygkGAkp/vDRPF"
+    ...     "QhPwnHpVD9TVPxHBQdHgM3bTo2TT+GoL7kw/s32ZiAH4OPvN5fN7bCkQWoUs/ySf"
+    ...     "oNbISMdvdtq07Rra2Biwzgjjs0ZcKbMicbDyYCe4gXlqK4wqcDfcwgrdqdG6NM0L"
+    ...     "UdekarWjnv0pMb6ttUl4U7e7Nf+eGkiTVItlppC8DyrnqC9SKCUAAAAVAOlEYNob"
+    ...     "JottyObVWQcrU8eAP4T5AAABAQDmJmL4DcQ1GVvw1Pjy57V0WUyGrOVBRVz7BwYB"
+    ...     "IvMA7xJCCvzd47mYWrWJkjV6O3tw2vG5oZx+BXE+ve8O6jL89CrwqncoUS8WHCoj"
+    ...     "RmuUHTmtCCiRBCH+/68HMCusO3Blk//kQSsaqfIn+8Xa56Vr2SweSUlLgjvb51+8"
+    ...     "9JJ13oDlUvdftW2GZu+grbmojqcoJ1LVAI5n0qsDItsFid46f8XfNzPeksasY9Jb"
+    ...     "Y5fKq/xf1KcgXL2F9XwmrDjFCuI4/xkJWNfGwaLKC/cbrJ1xmvPLl1/Hm5kNqgrw"
+    ...     "pNwHVOwyYSCUqXroU5PnpE9uydHUhjhtU2K2Hj0i7fOyxoxyAAABAQCpXKgd6lpT"
+    ...     "AEKm7ECY3TbJaTXPkNvAwg/2ud+PrtefHrVFFWrXrblSQhnmnc6ut8G3BsDzCljA"
+    ...     "IV2v+XcdOo+m8EViLf+Bi+gfbAIz4vdVepwQ2XHWUOTKk90i7Xqg4mUUDRIVw9io"
+    ...     "NF0GAHbNlJTK3FWC3gstbCJU2hyV3UzgB95b6zqpUHeyn1RK4VAFYGY9fCIdZNy9"
+    ...     "26HEart6uO/N6cO1ETw5B63kI8fTBjU7HLGgGXRjOv1APAqvKgry3tQD2WYkVJGR"
+    ...     "yYLjDK9d8nStUpwN5swI1xx2IWAbD+UCsRXAixn8s3mvpBD/jbnWjrzEensBc96j"
+    ...     "tiAsx2P5oXEd salgado@canario")
     >>> browser.getControl(name='sshkey').value = sshkey
     >>> browser.getControl('Import Public Key').click()
     >>> soup = find_main_content(browser.contents)
@@ -102,7 +127,10 @@ format.
     ...     print(tag.decode_contents())
     SSH public key added.
 
-    >>> sshkey = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJseCUmxVG7D6qh4JmhLp0Du4kScScJ9PtZ0LGHYHaURnRw9tbX1wwURAio8og6dbnT75CQ3TbUE/xJhxI0aFXE= salgado@canario"
+    >>> sshkey = (
+    ...     "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAy"
+    ...     "NTYAAABBBJseCUmxVG7D6qh4JmhLp0Du4kScScJ9PtZ0LGHYHaURnRw9tbX1wwUR"
+    ...     "Aio8og6dbnT75CQ3TbUE/xJhxI0aFXE= salgado@canario")
     >>> browser.getControl(name='sshkey').value = sshkey
     >>> browser.getControl('Import Public Key').click()
     >>> soup = find_main_content(browser.contents)
@@ -110,7 +138,11 @@ format.
     ...     print(tag.decode_contents())
     SSH public key added.
 
-    >>> sshkey = "ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBDUR0E0zCHRHJER6uzjfE/o0HAHFLcq/n8lp0duThpeIPsmo+wr3vHHuAAyOddOgkuQC8Lj8FzHlrOEYgXL6qa7FvpviE9YWUgmqVDa/yJbL/m6Mg8fvSIXlDJKmvOSv6g== salgado@canario"
+    >>> sshkey = (
+    ...     "ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAz"
+    ...     "ODQAAABhBDUR0E0zCHRHJER6uzjfE/o0HAHFLcq/n8lp0duThpeIPsmo+wr3vHHu"
+    ...     "AAyOddOgkuQC8Lj8FzHlrOEYgXL6qa7FvpviE9YWUgmqVDa/yJbL/m6Mg8fvSIXl"
+    ...     "DJKmvOSv6g== salgado@canario")
     >>> browser.getControl(name='sshkey').value = sshkey
     >>> browser.getControl('Import Public Key').click()
     >>> soup = find_main_content(browser.contents)
@@ -118,7 +150,12 @@ format.
     ...     print(tag.decode_contents())
     SSH public key added.
 
-    >>> sshkey = "ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAB3rpD+Ozb/kwUOqCZUXSiruAkIx6sNZLJyjJ0zxVTZSannaysCLxMQ/IiVxCd59+U2NaLduMzd93JcYDRlX3M5+AApY+3JjfSPo01Sb17HTLNSYU3RZWx0A3XJxm/YN+x/iuYZ3IziuAKeYMsNsdfHlO4/IWjw4Ruy0enW+QhWaY2qAQ== salgado@canario"
+    >>> sshkey = (
+    ...     "ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1"
+    ...     "MjEAAACFBAB3rpD+Ozb/kwUOqCZUXSiruAkIx6sNZLJyjJ0zxVTZSannaysCLxMQ"
+    ...     "/IiVxCd59+U2NaLduMzd93JcYDRlX3M5+AApY+3JjfSPo01Sb17HTLNSYU3RZWx0"
+    ...     "A3XJxm/YN+x/iuYZ3IziuAKeYMsNsdfHlO4/IWjw4Ruy0enW+QhWaY2qAQ== "
+    ...     "salgado@canario")
     >>> browser.getControl(name='sshkey').value = sshkey
     >>> browser.getControl('Import Public Key').click()
     >>> soup = find_main_content(browser.contents)
@@ -206,7 +243,14 @@ Keys containing non-ASCII comments
 These keys can be imported just like the others which have ASCII
 comments.
 
-    >>> key = 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzSc+OzlZaURcX8NK9Hy1VoA1SXXuxFAvLw9ljz6xXEFgodmkSgSE/Pc+nR2fO/hl0rnWi//8oOwkHlwLVPQpor2cjQlceVs9rKaQcrcwRm6Jmi8CYKlEIBq82kpaLwXwK/x5ZsDfFtYUq558C5IKZOnDozthC7REPYK0cQ8gZ4bLf+5hmJ6QO4sSRZcXTZuPvgUixhlazFo6w6GqWbynf29Wp+WkLFGxGF2UE/dI8HyQy2j7ddaLnW50mGfB00B/pYtO246s84097BRUE8XoBC3SvzsZx6IbI3hOd2e834lq6kOj6QI0wu6+GINRCZf5UyNlpJv6X809XBvq68SCgw== St\xc3\xa9phane'
+    >>> key = (
+    ...     'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzSc+OzlZaURcX8NK9Hy1VoA1SXXu'
+    ...     'xFAvLw9ljz6xXEFgodmkSgSE/Pc+nR2fO/hl0rnWi//8oOwkHlwLVPQpor2cjQlc'
+    ...     'eVs9rKaQcrcwRm6Jmi8CYKlEIBq82kpaLwXwK/x5ZsDfFtYUq558C5IKZOnDozth'
+    ...     'C7REPYK0cQ8gZ4bLf+5hmJ6QO4sSRZcXTZuPvgUixhlazFo6w6GqWbynf29Wp+Wk'
+    ...     'LFGxGF2UE/dI8HyQy2j7ddaLnW50mGfB00B/pYtO246s84097BRUE8XoBC3SvzsZ'
+    ...     'x6IbI3hOd2e834lq6kOj6QI0wu6+GINRCZf5UyNlpJv6X809XBvq68SCgw== '
+    ...     'St\xc3\xa9phane')
     >>> browser.open('http://launchpad.test/~salgado/+editsshkeys')
     >>> browser.getControl(name='sshkey').value = key
     >>> browser.getControl('Import Public Key').click()
diff --git a/lib/lp/registry/stories/person/xx-person-home.txt b/lib/lp/registry/stories/person/xx-person-home.txt
index 99fe5cb..6d7a782 100644
--- a/lib/lp/registry/stories/person/xx-person-home.txt
+++ b/lib/lp/registry/stories/person/xx-person-home.txt
@@ -126,7 +126,8 @@ The contact details portlet shows the languages that the user speaks. No
 Privileges Person can see the languages that mark speaks.
 
     >>> user_browser.open('http://launchpad.test/~carlos')
-    >>> print(extract_text(find_tag_by_id(user_browser.contents, 'languages')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     user_browser.contents, 'languages')))
     Languages:
     Catalan, English, Spanish
 
@@ -134,7 +135,8 @@ When viewing their own page, No Privileges Person sees their languages and
 can edit them.
 
     >>> user_browser.open('http://launchpad.test/~no-priv')
-    >>> print(extract_text(find_tag_by_id(user_browser.contents, 'languages')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     user_browser.contents, 'languages')))
     Languages: Set preferred languages
     English
 
diff --git a/lib/lp/registry/stories/pillar/xx-pillar-deactivation.txt b/lib/lp/registry/stories/pillar/xx-pillar-deactivation.txt
index f55c567..26f7411 100644
--- a/lib/lp/registry/stories/pillar/xx-pillar-deactivation.txt
+++ b/lib/lp/registry/stories/pillar/xx-pillar-deactivation.txt
@@ -25,12 +25,14 @@ cover that part of the change. See bug #156263 for more details.
 
 We start off with active and visible projects:
 
-    >>> anon_browser.open('http://launchpad.test/projects/+index?text=firefox')
+    >>> anon_browser.open(
+    ...     'http://launchpad.test/projects/+index?text=firefox')
     >>> anon_browser.getLink(url='/firefox').click()
     >>> anon_browser.title
     'Mozilla Firefox in Launchpad'
 
-    >>> anon_browser.open('http://launchpad.test/projects/+index?text=mozilla')
+    >>> anon_browser.open(
+    ...     'http://launchpad.test/projects/+index?text=mozilla')
     >>> anon_browser.getLink(url='/mozilla').click()
     >>> anon_browser.title
     'The Mozilla Project in Launchpad'
@@ -42,7 +44,8 @@ We then choose to disable them via each project's +review:
 
 The projects are now no longer publicly visible:
 
-    >>> anon_browser.open('http://launchpad.test/projects/+index?text=mozilla')
+    >>> anon_browser.open(
+    ...     'http://launchpad.test/projects/+index?text=mozilla')
     >>> anon_browser.getLink(url='/firefox')
     Traceback (most recent call last):
     ...
@@ -79,14 +82,16 @@ they'll see an informative message. They can then reactivate them..
 
 And they are back to normal:
 
-    >>> anon_browser.open('http://launchpad.test/projects/+index?text=firefox')
+    >>> anon_browser.open(
+    ...     'http://launchpad.test/projects/+index?text=firefox')
     >>> anon_browser.getLink(url='/firefox').click()
     >>> anon_browser.title
     'Mozilla Firefox in Launchpad'
     >>> print(find_tag_by_id(anon_browser.contents, 'project-inactive'))
     None
 
-    >>> anon_browser.open('http://launchpad.test/projects/+index?text=mozilla')
+    >>> anon_browser.open(
+    ...     'http://launchpad.test/projects/+index?text=mozilla')
     >>> anon_browser.getLink(url='/mozilla').click()
     >>> anon_browser.title
     'The Mozilla Project in Launchpad'
diff --git a/lib/lp/registry/stories/product/xx-product-index.txt b/lib/lp/registry/stories/product/xx-product-index.txt
index 6aa8dc8..f81b22c 100644
--- a/lib/lp/registry/stories/product/xx-product-index.txt
+++ b/lib/lp/registry/stories/product/xx-product-index.txt
@@ -108,7 +108,8 @@ Any user can see that the project's licence has not been reviewed.
 Changing the state to reviewed but not approved results in the project
 being shown as proprietary.
 
-    >>> admin_browser.open('http://launchpad.test/thunderbird/+review-license')
+    >>> admin_browser.open(
+    ...     'http://launchpad.test/thunderbird/+review-license')
     >>> admin_browser.getControl(name='field.project_reviewed').value = True
     >>> admin_browser.getControl(name='field.license_approved').value = False
     >>> admin_browser.getControl('Change').click()
diff --git a/lib/lp/registry/stories/product/xx-product-reassignment-and-milestones.txt b/lib/lp/registry/stories/product/xx-product-reassignment-and-milestones.txt
index a59227c..cc8e750 100644
--- a/lib/lp/registry/stories/product/xx-product-reassignment-and-milestones.txt
+++ b/lib/lp/registry/stories/product/xx-product-reassignment-and-milestones.txt
@@ -15,7 +15,8 @@ even if the user was trying to set the milestone value.
 
 (Revert the change we just made.)
 
-    >>> browser.open("http://bugs.launchpad.test/evolution/+bug/1/+editstatus";)
+    >>> browser.open(
+    ...     "http://bugs.launchpad.test/evolution/+bug/1/+editstatus";)
     >>> browser.getControl(name="evolution.target.product").value = "firefox"
     >>> browser.getControl("Save Changes").click()
 
diff --git a/lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt b/lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt
index 4ece9de..48fe0c4 100644
--- a/lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt
+++ b/lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt
@@ -73,7 +73,8 @@ the "Keep the milestone <name> active" checkbox.
     >>> browser.open('http://launchpad.test/firefox/trunk/+addmilestone')
     >>> browser.getControl('Name').value = 'bar'
     >>> browser.getControl('Register Milestone').click()
-    >>> browser.open('http://launchpad.test/firefox/+milestone/bar/+addrelease')
+    >>> browser.open(
+    ...     'http://launchpad.test/firefox/+milestone/bar/+addrelease')
     >>> browser.getControl("Date released").value = '2009-01-01'
     >>> browser.getControl("Keep the bar milestone active.").selected = True
     >>> browser.getControl('Create release').click()
@@ -94,7 +95,8 @@ has a productrelease.
     ...
     zope.testbrowser.browser.LinkNotFoundError
 
-    >>> browser.open('http://launchpad.test/firefox/+milestone/1.0/+addrelease')
+    >>> browser.open(
+    ...     'http://launchpad.test/firefox/+milestone/1.0/+addrelease')
     >>> browser.url
     'http://launchpad.test/firefox/trunk/1.0/+edit'
     >>> for tag in find_tags_by_class(browser.contents, 'message'):
@@ -146,7 +148,8 @@ Let's add a release as Jeff:
 
 Celso is a member of ubuntu-team, so he can edit this release too:
 
-    >>> browser = setupBrowser(auth='Basic celso.providelo@xxxxxxxxxxxxx:test')
+    >>> browser = setupBrowser(
+    ...     auth='Basic celso.providelo@xxxxxxxxxxxxx:test')
     >>> browser.open('http://launchpad.test/tomcat/trunk/0.6.6.6')
     >>> browser.getLink('Change release details', index=0).click()
     >>> print(browser.title)
diff --git a/lib/lp/registry/stories/productrelease/xx-productrelease-view.txt b/lib/lp/registry/stories/productrelease/xx-productrelease-view.txt
index 05f00e4..3a8d23e 100644
--- a/lib/lp/registry/stories/productrelease/xx-productrelease-view.txt
+++ b/lib/lp/registry/stories/productrelease/xx-productrelease-view.txt
@@ -46,7 +46,8 @@ downloaded and the date of the last download on that table as well.
     >>> lfa.updateDownloadCount(date(2006, 5, 4), None, 1)
 
     >>> anon_browser.reload()
-    >>> print(extract_text(find_tag_by_id(anon_browser.contents, 'downloads')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     anon_browser.contents, 'downloads')))
     File                            Description  Downloads
     firefox_0.9.2.orig.tar.gz (md5)              1 last downloaded ...
                               Total downloads:   1
@@ -58,7 +59,8 @@ downloaded, so we can't say it was downloaded a few minutes/hours ago.
     >>> import pytz
     >>> lfa.updateDownloadCount(datetime.now(pytz.utc).date(), None, 4356)
     >>> anon_browser.reload()
-    >>> print(extract_text(find_tag_by_id(anon_browser.contents, 'downloads')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     anon_browser.contents, 'downloads')))
     File                            Description  Downloads
     firefox_0.9.2.orig.tar.gz (md5)              4,357 last downloaded today
                               Total downloads:   4,357
diff --git a/lib/lp/registry/stories/project/xx-project-add-product.txt b/lib/lp/registry/stories/project/xx-project-add-product.txt
index b01d6c5..68f4252 100644
--- a/lib/lp/registry/stories/project/xx-project-add-product.txt
+++ b/lib/lp/registry/stories/project/xx-project-add-product.txt
@@ -17,7 +17,8 @@ us on the same page.
 
     >>> browser.getControl(name='field.display_name').value = 'Eye of GNOME'
     >>> browser.getControl(name='field.name', index=0).value = 'eog'
-    >>> browser.getControl(name='field.summary').value = 'An image viewer for GNOME'
+    >>> browser.getControl(name='field.summary').value = (
+    ...     'An image viewer for GNOME')
     >>> browser.getControl('Continue').click()
     >>> print(browser.url)
     http://launchpad.test/gnome/+newproduct
diff --git a/lib/lp/registry/stories/team-polls/create-poll-options.txt b/lib/lp/registry/stories/team-polls/create-poll-options.txt
index 1a8027c..a3e8a84 100644
--- a/lib/lp/registry/stories/team-polls/create-poll-options.txt
+++ b/lib/lp/registry/stories/team-polls/create-poll-options.txt
@@ -25,7 +25,8 @@ Our poll is not yet open, so new options can be added to it.
     'http://launchpad.test/~ubuntu-team/+poll/dpl-2080/+newoption'
 
     >>> bill_name = (
-    ...     'bill-amazingly-huge-middle-name-almost-impossible-to-read-graham')
+    ...     'bill-amazingly-huge-middle-name-almost-impossible-to-read-'
+    ...     'graham')
     >>> team_admin_browser.getControl('Name').value = bill_name
     >>> team_admin_browser.getControl('Title').value = 'Bill Graham'
     >>> team_admin_browser.getControl('Create').click()
@@ -51,7 +52,8 @@ message because the title is required.
     'http://launchpad.test/~ubuntu-team/+poll/dpl-2080/+newoption'
 
     >>> will_name = (
-    ...     'will-amazingly-huge-middle-name-almost-impossible-to-read-graham')
+    ...     'will-amazingly-huge-middle-name-almost-impossible-to-read-'
+    ...     'graham')
     >>> team_admin_browser.getControl('Name').value = will_name
     >>> team_admin_browser.getControl('Title').value = ''
     >>> team_admin_browser.getControl('Create').click()
@@ -75,12 +77,14 @@ It's not possible to add/edit a poll option after a poll is open or closed.
 That's only possible when the poll is not yet open.
 
     >>> team_admin_browser.open(
-    ...     'http://launchpad.test/~ubuntu-team/+poll/director-2004/+newoption')
+    ...     'http://launchpad.test/~ubuntu-team/+poll/director-2004/'
+    ...     '+newoption')
 
     >>> print_feedback_messages(team_admin_browser.contents)
     You can’t add new options because the poll is already closed.
 
     >>> team_admin_browser.open(
-    ...     'http://launchpad.test/~ubuntu-team/+poll/never-closes/+newoption')
+    ...     'http://launchpad.test/~ubuntu-team/+poll/never-closes/'
+    ...     '+newoption')
     >>> print_feedback_messages(team_admin_browser.contents)
     You can’t add new options because the poll is already open.
diff --git a/lib/lp/registry/stories/team-polls/edit-options.txt b/lib/lp/registry/stories/team-polls/edit-options.txt
index 8610451..75d51c4 100644
--- a/lib/lp/registry/stories/team-polls/edit-options.txt
+++ b/lib/lp/registry/stories/team-polls/edit-options.txt
@@ -51,8 +51,8 @@ been opened yet, he should be able to edit its options.
 
     >>> browser.url
     'http://launchpad.test/~ubuntu-team/+poll/not-yet-opened'
-    >>> print(
-    ...     find_portlet(browser.contents, 'Voting options').decode_contents())
+    >>> print(find_portlet(
+    ...     browser.contents, 'Voting options').decode_contents())
     <BLANKLINE>
     <h2>Voting options</h2>
     ...
diff --git a/lib/lp/registry/stories/team/xx-team-membership.txt b/lib/lp/registry/stories/team/xx-team-membership.txt
index ccab69b..96f26e6 100644
--- a/lib/lp/registry/stories/team/xx-team-membership.txt
+++ b/lib/lp/registry/stories/team/xx-team-membership.txt
@@ -117,7 +117,8 @@ Jeff is also an administrator and his subscription never expires, but he can
 demote himself. He starts by paging though the memberships, then he deselects
 the administrator control on the membership page.
 
-    >>> jdub_browser = setupBrowser(auth='Basic jeff.waugh@xxxxxxxxxxxxxxx:test')
+    >>> jdub_browser = setupBrowser(
+    ...     auth='Basic jeff.waugh@xxxxxxxxxxxxxxx:test')
     >>> jdub_browser.open('http://launchpad.test/~ubuntu-team/+members')
     >>> jdub_browser.getLink('Next').click()
     >>> url = '/~ubuntu-team/+member/jdub'
@@ -184,7 +185,8 @@ But in the second browser with the stale data we get an error message:
 
     >>> second_browser.getControl('Approve').click()
     >>> message = (
-    ...     'The membership request for Dave Miller has already been processed')
+    ...     'The membership request for Dave Miller has already been '
+    ...     'processed')
     >>> message in six.ensure_text(second_browser.contents)
     True
 
diff --git a/lib/lp/registry/stories/teammembership/xx-add-member.txt b/lib/lp/registry/stories/teammembership/xx-add-member.txt
index f5a2733..df20ef9 100644
--- a/lib/lp/registry/stories/teammembership/xx-add-member.txt
+++ b/lib/lp/registry/stories/teammembership/xx-add-member.txt
@@ -90,7 +90,8 @@ invitation. Not even an admin of the landscape team (which as so has the
 rights to edit the membership in question) can do it.
 
     >>> landscape_admin_browser.open(
-    ...    'http://launchpad.test/~launchpad/+invitation/landscape-developers')
+    ...    'http://launchpad.test/~launchpad/+invitation/'
+    ...    'landscape-developers')
     Traceback (most recent call last):
     ...
     zope.security.interfaces.Unauthorized: ...
diff --git a/lib/lp/registry/stories/webservice/xx-distribution-mirror.txt b/lib/lp/registry/stories/webservice/xx-distribution-mirror.txt
index c8d49f7..5321b46 100644
--- a/lib/lp/registry/stories/webservice/xx-distribution-mirror.txt
+++ b/lib/lp/registry/stories/webservice/xx-distribution-mirror.txt
@@ -8,7 +8,8 @@ archive mirrors:
     >>> distros = webservice.get("/distros").jsonBody()
     >>> distro = distros['entries'][0]
     >>> ubuntu = webservice.get(distro['self_link']).jsonBody()
-    >>> ubuntu_archive_mirrors = webservice.get(ubuntu['archive_mirrors_collection_link']).jsonBody()
+    >>> ubuntu_archive_mirrors = webservice.get(
+    ...     ubuntu['archive_mirrors_collection_link']).jsonBody()
     >>> canonical_archive = webservice.named_get(
     ...     ubuntu['self_link'], 'getMirrorByName',
     ...     name='canonical-archive').jsonBody()
@@ -39,9 +40,11 @@ archive mirrors:
 
 And CD image mirrors:
 
-    >>> ubuntu_cd_mirrors = webservice.get(ubuntu['cdimage_mirrors_collection_link']).jsonBody()
+    >>> ubuntu_cd_mirrors = webservice.get(
+    ...     ubuntu['cdimage_mirrors_collection_link']).jsonBody()
     >>> canonical_releases =  ubuntu_cd_mirrors['entries'][0]
-    >>> canonical_releases_json = webservice.get(canonical_releases['self_link']).jsonBody()
+    >>> canonical_releases_json = webservice.get(
+    ...     canonical_releases['self_link']).jsonBody()
     >>> pprint_entry(canonical_releases_json)
     content: 'CD Image'
     country_dns_mirror: False
@@ -221,7 +224,8 @@ While others can be set with the appropriate authorization:
     401
 
     >>> response = karl_webservice.patch(
-    ...     canonical_releases['self_link'], 'application/json', dumps(patch)).jsonBody()
+    ...     canonical_releases['self_link'], 'application/json',
+    ...     dumps(patch)).jsonBody()
     >>> pprint_entry(response)
     content: 'CD Image'
     country_dns_mirror: False
@@ -255,8 +259,8 @@ DistributionMirror has some custom operations.
 "isOfficial" returns a boolean result on whether a mirror is an official
 mirror or not.
 
-    >>> is_official_mirror = webservice.named_get(canonical_releases['self_link'],
-    ...     'isOfficial').jsonBody()
+    >>> is_official_mirror = webservice.named_get(
+    ...     canonical_releases['self_link'], 'isOfficial').jsonBody()
     >>> print(is_official_mirror)
     False
 
diff --git a/lib/lp/registry/stories/webservice/xx-project-registry.txt b/lib/lp/registry/stories/webservice/xx-project-registry.txt
index f758070..12faf44 100644
--- a/lib/lp/registry/stories/webservice/xx-project-registry.txt
+++ b/lib/lp/registry/stories/webservice/xx-project-registry.txt
@@ -594,7 +594,8 @@ The project collection has a method for creating a new project.
     ...         title=title, summary=summary, description=description,
     ...         project_group=project_group, homepage_url=homepage_url,
     ...         screenshots_url=screenshots_url, wiki_url=wiki_url,
-    ...         download_url=download_url, freshmeat_project=freshmeat_project,
+    ...         download_url=download_url,
+    ...         freshmeat_project=freshmeat_project,
     ...         sourceforge_project=sourceforge_project,
     ...         programming_lang=programming_lang,
     ...         licenses=licenses, license_info=license_info,
diff --git a/lib/lp/services/database/doc/sqlbaseconnect.txt b/lib/lp/services/database/doc/sqlbaseconnect.txt
index 9a933c0..b6d4243 100644
--- a/lib/lp/services/database/doc/sqlbaseconnect.txt
+++ b/lib/lp/services/database/doc/sqlbaseconnect.txt
@@ -13,7 +13,8 @@ Ensure that lp.services.database.sqlbase connects as we expect.
     ...     where = cur.fetchone()[0]
     ...     cur.execute('SHOW transaction_isolation')
     ...     how = cur.fetchone()[0]
-    ...     print('Connected as %s to %s in %s isolation.' % (who, where, how))
+    ...     print(
+    ...         'Connected as %s to %s in %s isolation.' % (who, where, how))
 
 Specifying the user connects as that user.
 
diff --git a/lib/lp/services/database/doc/textsearching.txt b/lib/lp/services/database/doc/textsearching.txt
index 63e5d5a..72f365e 100644
--- a/lib/lp/services/database/doc/textsearching.txt
+++ b/lib/lp/services/database/doc/textsearching.txt
@@ -278,7 +278,8 @@ string finds the indexed text.
     '~' FTI data: 'foo':1 '~bar':2 query: 'foo' & '~bar' match: True
 
     >>> for symbol in punctuation:
-    ...     print(repr(symbol), search_same('aa %sbb%s cc' % (symbol, symbol)))
+    ...     print(repr(symbol),
+    ...           search_same('aa %sbb%s cc' % (symbol, symbol)))
     "'" FTI data: 'aa':1 'bb':2 'cc':3 query: 'aa' & 'bb' & 'cc' match: True
     '"' FTI data: 'aa':1 'bb':2 'cc':3 query: 'aa' & 'bb' & 'cc' match: True
     '#' FTI data: 'aa':1 'bb':2 'cc':3 query: 'aa' & 'bb' & 'cc' match: True
@@ -705,7 +706,8 @@ More than 50% of the questions matches firefox:
 
 So firefox will be removed from the final query:
 
-    >>> print(nl_phrase_search('system is slow when running firefox', Question,
+    >>> print(nl_phrase_search(
+    ...     'system is slow when running firefox', Question,
     ...     fast_enabled=False))
     system|slow|run
 
@@ -717,8 +719,8 @@ So firefox will be removed from the final query:
 The fast code path does not remove any terms. Rather it uses an & query over
 all the terms combined with an & query for each ordinal-1 subset of the terms:
 
-    >>> print(nl_phrase_search('system is slow when running firefox on ubuntu',
-    ...     Question))
+    >>> print(nl_phrase_search(
+    ...     'system is slow when running firefox on ubuntu', Question))
     (firefox&run&slow&system&ubuntu)|(run&slow&system&ubuntu)|(firefox&slow&system&ubuntu)|(firefox&run&system&ubuntu)|(firefox&run&slow&ubuntu)|(firefox&run&slow&system)
 
 Short queries are expanded more simply:
@@ -806,5 +808,6 @@ questions:
     >>> print(nl_phrase_search(
     ...     'firefox is slow', Question,
     ...     [Question.distribution == ubuntu,
-    ...      Question.sourcepackagename == firefox_package.sourcepackagename]))
+    ...      Question.sourcepackagename ==
+    ...         firefox_package.sourcepackagename]))
     firefox|slow
diff --git a/lib/lp/services/feeds/stories/xx-links.txt b/lib/lp/services/feeds/stories/xx-links.txt
index ce07330..27a2fdf 100644
--- a/lib/lp/services/feeds/stories/xx-links.txt
+++ b/lib/lp/services/feeds/stories/xx-links.txt
@@ -389,7 +389,9 @@ But if the branch is private, there should be no link.
 Even so, if they somehow manage to hack the url, they are redirected to a page
 with an error notification:
 
-    >>> browser.open('http://feeds.launchpad.test/~name12/landscape/feature-x/branch.atom')
+    >>> browser.open(
+    ...     'http://feeds.launchpad.test/~name12/landscape/feature-x/'
+    ...     'branch.atom')
     >>> print(browser.url)
     http://code.launchpad.test/
     >>> print_feedback_messages(browser.contents)
diff --git a/lib/lp/services/oauth/doc/oauth-pages.txt b/lib/lp/services/oauth/doc/oauth-pages.txt
index 65d5515..14f33d8 100644
--- a/lib/lp/services/oauth/doc/oauth-pages.txt
+++ b/lib/lp/services/oauth/doc/oauth-pages.txt
@@ -16,7 +16,7 @@ consumer's request to access Launchpad on their behalf.
     >>> from lp.services.webapp.interfaces import ILaunchpadRoot
     >>> from lp.services.webapp.servers import LaunchpadTestRequest
 
-    >>> consumer = getUtility(IOAuthConsumerSet).getByKey(u'launchpad-library')
+    >>> consumer = getUtility(IOAuthConsumerSet).getByKey('launchpad-library')
     >>> root = getUtility(ILaunchpadRoot)
     >>> def get_view_with_fresh_token(form):
     ...     token, _ = consumer.newRequestToken()
diff --git a/lib/lp/services/oauth/stories/managing-tokens.txt b/lib/lp/services/oauth/stories/managing-tokens.txt
index 936a63d..e51af5e 100644
--- a/lib/lp/services/oauth/stories/managing-tokens.txt
+++ b/lib/lp/services/oauth/stories/managing-tokens.txt
@@ -92,7 +92,8 @@ shown as one of the authorized ones.
     Authorization revoked successfully.
 
     >>> my_browser.open('http://launchpad.test/~salgado/+oauth-tokens')
-    >>> print(extract_text(find_tag_by_id(my_browser.contents, 'maincontent')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     my_browser.contents, 'maincontent')))
     Authorized applications
     ...
     Claimed tokens:
@@ -119,7 +120,8 @@ include that.
     >>> access_token, _ = token.createAccessToken()
     >>> logout()
     >>> my_browser.open('http://launchpad.test/~salgado/+oauth-tokens')
-    >>> print(extract_text(find_tag_by_id(my_browser.contents, 'maincontent')))
+    >>> print(extract_text(find_tag_by_id(
+    ...     my_browser.contents, 'maincontent')))
     Authorized applications
     ...
     launchpad-library
diff --git a/lib/lp/services/verification/browser/tests/logintoken-views.txt b/lib/lp/services/verification/browser/tests/logintoken-views.txt
index 8eb19b4..937b458 100644
--- a/lib/lp/services/verification/browser/tests/logintoken-views.txt
+++ b/lib/lp/services/verification/browser/tests/logintoken-views.txt
@@ -20,7 +20,9 @@ addresses, so here we'll make sure that even non-logged-in users can
 perform the last step of the workflow for adding a GPG key.
 
     >>> from zope.component import getMultiAdapter
-    >>> from lp.services.verification.interfaces.authtoken import LoginTokenType
+    >>> from lp.services.verification.interfaces.authtoken import (
+    ...     LoginTokenType,
+    ...     )
     >>> from lp.services.verification.interfaces.logintoken import (
     ...     ILoginTokenSet)
     >>> from lp.services.webapp.servers import LaunchpadTestRequest
diff --git a/lib/lp/services/verification/doc/logintoken.txt b/lib/lp/services/verification/doc/logintoken.txt
index b3f3694..9a8587c 100644
--- a/lib/lp/services/verification/doc/logintoken.txt
+++ b/lib/lp/services/verification/doc/logintoken.txt
@@ -19,7 +19,9 @@ follows:
     4) The token is now marked as consumed, together with any other
        tokens of the same type and for the same email address.
 
-    >>> from lp.services.verification.interfaces.authtoken import LoginTokenType
+    >>> from lp.services.verification.interfaces.authtoken import (
+    ...     LoginTokenType,
+    ...     )
     >>> from lp.registry.model.person import Person
     >>> from lp.services.verification.interfaces.logintoken import (
     ...     ILoginTokenSet)
diff --git a/lib/lp/services/webapp/doc/canonical_url.txt b/lib/lp/services/webapp/doc/canonical_url.txt
index 54b8803..c0c35b9 100644
--- a/lib/lp/services/webapp/doc/canonical_url.txt
+++ b/lib/lp/services/webapp/doc/canonical_url.txt
@@ -376,7 +376,8 @@ zope.publisher.interfaces.http.IHTTPApplicationRequest.
     ...             return self.getApplicationURL() + '/'
     ...
     ...     def getApplicationURL(self, depth=0, path_only=False):
-    ...         assert depth == 0, 'this is not a real IHTTPApplicationRequest'
+    ...         assert depth == 0, (
+    ...             'this is not a real IHTTPApplicationRequest')
     ...         assert not path_only, 'not a real IHTTPApplicationRequest'
     ...         return self.applicationurl
 
diff --git a/lib/lp/services/webapp/doc/menus.txt b/lib/lp/services/webapp/doc/menus.txt
index b2f9619..c1cf9b4 100644
--- a/lib/lp/services/webapp/doc/menus.txt
+++ b/lib/lp/services/webapp/doc/menus.txt
@@ -102,7 +102,8 @@ mark is as being "structured".
     >>> from lp.services.webapp import structured
     >>> text = structured('some <b>%s</b> text', ' --> ')
 
-    >>> full_link = Link('target', text, 'summary', icon='icon', enabled=False)
+    >>> full_link = Link(
+    ...     'target', text, 'summary', icon='icon', enabled=False)
     >>> ILinkData.providedBy(full_link)
     True
 
diff --git a/lib/lp/services/webapp/doc/navigation.txt b/lib/lp/services/webapp/doc/navigation.txt
index 19ee42f..5d4348d 100644
--- a/lib/lp/services/webapp/doc/navigation.txt
+++ b/lib/lp/services/webapp/doc/navigation.txt
@@ -507,7 +507,8 @@ with the remainder of the URL and or query string.
     ...
     ...     @stepto('+foo')
     ...     def traverse_foo(self):
-    ...         return self.redirectSubTree('http://wiki.canonical.com', status=303)
+    ...         return self.redirectSubTree(
+    ...             'http://wiki.canonical.com', status=303)
 
     >>> navigation5 = ThingSetNavigation5(thingset, request)
     >>> navigation5.publishTraverse(request, 'jobs')
diff --git a/lib/lp/services/webapp/doc/test_adapter_permissions.txt b/lib/lp/services/webapp/doc/test_adapter_permissions.txt
index f86b958..8cf15f6 100644
--- a/lib/lp/services/webapp/doc/test_adapter_permissions.txt
+++ b/lib/lp/services/webapp/doc/test_adapter_permissions.txt
@@ -39,7 +39,8 @@ If a MASTER_FLAVOR is requested, it should allow writes to table in that
 Store's replication set.
 
     >>> t = transaction.begin()
-    >>> main_master = getUtility(IStoreSelector).get(MAIN_STORE, MASTER_FLAVOR)
+    >>> main_master = getUtility(IStoreSelector).get(
+    ...     MAIN_STORE, MASTER_FLAVOR)
     >>> main_master.find(Person, name='janitor').one().display_name = 'BenD'
     >>> transaction.commit()
     >>> t = transaction.begin()
diff --git a/lib/lp/soyuz/browser/tests/archive-views.txt b/lib/lp/soyuz/browser/tests/archive-views.txt
index d59c774..69566a0 100644
--- a/lib/lp/soyuz/browser/tests/archive-views.txt
+++ b/lib/lp/soyuz/browser/tests/archive-views.txt
@@ -370,7 +370,8 @@ others will not.
     >>> login('foo.bar@xxxxxxxxxxxxx')
     >>> removeSecurityProxy(view.filtered_sources[0]).datecreated = UTC_NOW
     >>> removeSecurityProxy(view.filtered_sources[1]).datecreated = UTC_NOW
-    >>> removeSecurityProxy(view.filtered_sources[2]).datecreated = thirtyone_days_ago
+    >>> removeSecurityProxy(view.filtered_sources[2]).datecreated = (
+    ...     thirtyone_days_ago)
     >>> login(ANONYMOUS)
 
     >>> view.num_updates_over_last_days()
diff --git a/lib/lp/soyuz/browser/tests/distribution-views.txt b/lib/lp/soyuz/browser/tests/distribution-views.txt
index c6eff7f..1197e9d 100644
--- a/lib/lp/soyuz/browser/tests/distribution-views.txt
+++ b/lib/lp/soyuz/browser/tests/distribution-views.txt
@@ -208,7 +208,8 @@ package:
 
     >>> distro_pkg_search_view = create_initialized_view(
     ...     ubuntu, name="+search", form={'text': 'moz'})
-    >>> for key, value in distro_pkg_search_view.matching_binary_names.items():
+    >>> for key, value in (
+    ...         distro_pkg_search_view.matching_binary_names.items()):
     ...     print('%s: %s' % (key, value))
     mozilla-firefox: mozilla-firefox, mozilla-firefox-data
 
diff --git a/lib/lp/soyuz/browser/tests/distributionsourcepackagerelease-views.txt b/lib/lp/soyuz/browser/tests/distributionsourcepackagerelease-views.txt
index 852e351..90ce8e3 100644
--- a/lib/lp/soyuz/browser/tests/distributionsourcepackagerelease-views.txt
+++ b/lib/lp/soyuz/browser/tests/distributionsourcepackagerelease-views.txt
@@ -104,7 +104,8 @@ copies.
     ...     for build_group in dspr_view.grouped_builds:
     ...         arch_tags = ' '.join(
     ...             build.arch_tag for build in build_group['builds'])
-    ...         print('%s: %s' % (build_group['distroseries'].name, arch_tags))
+    ...         print('%s: %s' %
+    ...               (build_group['distroseries'].name, arch_tags))
     ...     print('END')
 
     >>> print_grouped_builds()
diff --git a/lib/lp/soyuz/doc/archivepermission.txt b/lib/lp/soyuz/doc/archivepermission.txt
index e32e39e..6675914 100644
--- a/lib/lp/soyuz/doc/archivepermission.txt
+++ b/lib/lp/soyuz/doc/archivepermission.txt
@@ -19,7 +19,8 @@ Two main operations are supported: upload and queue administration.
 The ArchivePermission context class implements the IArchivePermission
 interface.
 
-    >>> random_permission = IStore(ArchivePermission).get(ArchivePermission, 1)
+    >>> random_permission = IStore(ArchivePermission).get(
+    ...     ArchivePermission, 1)
     >>> verifyObject(IArchivePermission, random_permission)
     True
 
diff --git a/lib/lp/soyuz/doc/distroseriesqueue-notify.txt b/lib/lp/soyuz/doc/distroseriesqueue-notify.txt
index 5b90c8b..5b96736 100644
--- a/lib/lp/soyuz/doc/distroseriesqueue-notify.txt
+++ b/lib/lp/soyuz/doc/distroseriesqueue-notify.txt
@@ -108,7 +108,8 @@ to the changer.
 
     >>> from zope.security.proxy import removeSecurityProxy
     >>> from lp.registry.interfaces.gpg import IGPGKeySet
-    >>> gpgkey = getUtility(IGPGKeySet).getByFingerprint('ABCDEF0123456789ABCDDCBA0000111112345678')
+    >>> gpgkey = getUtility(IGPGKeySet).getByFingerprint(
+    ...     'ABCDEF0123456789ABCDDCBA0000111112345678')
     >>> removeSecurityProxy(netapplet_upload).signing_key_owner = gpgkey.owner
     >>> removeSecurityProxy(netapplet_upload).signing_key_fingerprint = (
     ...     gpgkey.fingerprint)
@@ -217,7 +218,9 @@ parameter provided that everything is already committed to the database
 (which is not the case when nascent upload runs).  This example
 demonstrates this usage:
 
-    >>> from lp.services.librarianserver.testing.server import fillLibrarianFile
+    >>> from lp.services.librarianserver.testing.server import (
+    ...     fillLibrarianFile,
+    ...     )
     >>> changes_file = open(changes_file_path, "rb")
     >>> fillLibrarianFile(1, content=changes_file.read())
     >>> changes_file.close()
diff --git a/lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt b/lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt
index 2f9de6a..345c295 100644
--- a/lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt
+++ b/lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt
@@ -335,8 +335,8 @@ are displayed.
 
 A link to further PPA searches is also included.
 
-    >>> link = browser.getLink(
-    ...     url='http://launchpad.test/ubuntutest/+ppas?name_filter=netapplet')
+    >>> link = browser.getLink(url=(
+    ...     'http://launchpad.test/ubuntutest/+ppas?name_filter=netapplet'))
     >>> link.text
     "...other untrusted versions of..."
 
diff --git a/lib/lp/soyuz/stories/packaging/package-pages-navigation.txt b/lib/lp/soyuz/stories/packaging/package-pages-navigation.txt
index 421e436..caf14f7 100644
--- a/lib/lp/soyuz/stories/packaging/package-pages-navigation.txt
+++ b/lib/lp/soyuz/stories/packaging/package-pages-navigation.txt
@@ -28,7 +28,8 @@ pages.
     * Answers - http://answers.launchpad.test/ubuntu/+source/alsa-utils
     Main heading: alsa-utils package in Ubuntu
 
-    >>> anon_browser.open('http://bugs.launchpad.test/ubuntu/+source/alsa-utils')
+    >>> anon_browser.open(
+    ...     'http://bugs.launchpad.test/ubuntu/+source/alsa-utils')
     >>> print_location(anon_browser.contents)
     Hierarchy: Ubuntu > alsa-utils package
     Tabs:
@@ -70,7 +71,8 @@ A distribution source package release build should have almost the same
 navigation as its parent distribution source package release.
 
     >>> anon_browser.open(
-    ...     'http://launchpad.test/ubuntu/+source/alsa-utils/1.0.9a-4ubuntu1/+build/11')
+    ...     'http://launchpad.test/ubuntu/+source/alsa-utils/1.0.9a-4ubuntu1/'
+    ...     '+build/11')
     >>> print_location(anon_browser.contents)
     Hierarchy: Ubuntu > alsa-utils package > 1.0.9a-4ubuntu1 > i386 build
     Tabs:
diff --git a/lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt b/lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt
index 8467076..6d8655a 100644
--- a/lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt
+++ b/lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt
@@ -16,7 +16,8 @@ edit dependencies, even if they try the URL directly.
     zope.testbrowser.browser.LinkNotFoundError
 
     >>> anon_browser.open(
-    ...     'http://launchpad.test/~cprov/+archive/ubuntu/ppa/+edit-dependencies')
+    ...     'http://launchpad.test/~cprov/+archive/ubuntu/ppa/'
+    ...     '+edit-dependencies')
     Traceback (most recent call last):
     ...
     zope.security.interfaces.Unauthorized: ..., 'launchpad.Edit')
@@ -28,7 +29,8 @@ edit dependencies, even if they try the URL directly.
     zope.testbrowser.browser.LinkNotFoundError
 
     >>> user_browser.open(
-    ...    'http://launchpad.test/~cprov/+archive/ubuntu/ppa/+edit-dependencies')
+    ...    'http://launchpad.test/~cprov/+archive/ubuntu/ppa/'
+    ...    '+edit-dependencies')
     Traceback (most recent call last):
     ...
     zope.security.interfaces.Unauthorized: ..., 'launchpad.Edit')
@@ -38,7 +40,8 @@ any sources.
 
     >>> no_priv_browser = setupBrowser(
     ...     auth='Basic no-priv@xxxxxxxxxxxxx:test')
-    >>> no_priv_browser.open("http://launchpad.test/~no-priv/+archive/ubuntu/ppa";)
+    >>> no_priv_browser.open(
+    ...     "http://launchpad.test/~no-priv/+archive/ubuntu/ppa";)
 
     >>> no_priv_browser.getLink('Edit PPA dependencies').click()
     >>> print(no_priv_browser.url)
@@ -114,7 +117,8 @@ When a valid PPA is chosen the dependency is added, a notification
 is rendered on top of the page and the list of dependencies available
 for removal is updated.
 
-    >>> admin_browser.getControl("Add PPA dependency").value = '~mark/ubuntu/ppa'
+    >>> admin_browser.getControl("Add PPA dependency").value = (
+    ...     '~mark/ubuntu/ppa')
     >>> admin_browser.getControl("Save").click()
     >>> print_feedback_messages(admin_browser.contents)
     Dependency added: PPA for Mark Shuttleworth
@@ -125,7 +129,8 @@ for removal is updated.
 
 Trying to add a dependency that is already recorded results in a error.
 
-    >>> admin_browser.getControl("Add PPA dependency").value = '~mark/ubuntu/ppa'
+    >>> admin_browser.getControl("Add PPA dependency").value = (
+    ...     '~mark/ubuntu/ppa')
     >>> admin_browser.getControl("Save").click()
     >>> print_feedback_messages(admin_browser.contents)
     There is 1 error.
@@ -134,7 +139,8 @@ Trying to add a dependency that is already recorded results in a error.
 Trying to add a dependency for the context PPA itself also results in
 a error.
 
-    >>> admin_browser.getControl("Add PPA dependency").value = '~cprov/ubuntu/ppa'
+    >>> admin_browser.getControl("Add PPA dependency").value = (
+    ...     '~cprov/ubuntu/ppa')
     >>> admin_browser.getControl("Save").click()
     >>> print_feedback_messages(admin_browser.contents)
     There is 1 error.
@@ -142,14 +148,16 @@ a error.
 
 If it's a new dependency everything is fine.
 
-    >>> admin_browser.getControl("Add PPA dependency").value = '~no-priv/ubuntu/ppa'
+    >>> admin_browser.getControl("Add PPA dependency").value = (
+    ...     '~no-priv/ubuntu/ppa')
     >>> admin_browser.getControl("Save").click()
     >>> print_feedback_messages(admin_browser.contents)
     Dependency added: PPA for No Privileges Person
 
 Now Celso's PPA will list Mark's and No-Priv's PPA as its dependencies.
+Reloading will set old form values.
 
-    >>> admin_browser.open(admin_browser.url) # Reload will set old form values.
+    >>> admin_browser.open(admin_browser.url)
     >>> print_ppa_dependencies(admin_browser.contents)
     PPA for Mark Shuttleworth
     PPA for No Privileges Person
@@ -273,7 +281,8 @@ dependency.
     >>> logout()
 
     # Attempt to add Mark's PPA
-    >>> admin_browser.getControl("Add PPA dependency").value = '~mark/ubuntu/ppa'
+    >>> admin_browser.getControl("Add PPA dependency").value = (
+    ...     '~mark/ubuntu/ppa')
     >>> admin_browser.getControl("Save").click()
     >>> print_feedback_messages(admin_browser.contents)
     There is 1 error.
@@ -462,7 +471,8 @@ The form can perform multiple actions in a single submit.
 
 First we will create a PPA dependency for 'No privileged' PPA.
 
-    >>> admin_browser.getControl("Add PPA dependency").value = '~no-priv/ubuntu/ppa'
+    >>> admin_browser.getControl("Add PPA dependency").value = (
+    ...     '~no-priv/ubuntu/ppa')
     >>> admin_browser.getControl("Save").click()
     >>> print_feedback_messages(admin_browser.contents)
     Dependency added: PPA for No Privileges Person
@@ -491,13 +501,14 @@ In a single submit we will remove the PPA dependency, add another one
 from 'Mark Shuttleworth' PPA and modify the primary dependency to
 RELEASE.
 
-    >>> admin_browser.getControl(
-    ...     name="field.selected_dependencies").value = ['~no-priv/ubuntu/ppa']
+    >>> admin_browser.getControl(name="field.selected_dependencies").value = (
+    ...     ['~no-priv/ubuntu/ppa'])
 
     >>> admin_browser.getControl(
     ...     "Use all Ubuntu components available.").selected = True
 
-    >>> admin_browser.getControl("Add PPA dependency").value = '~mark/ubuntu/ppa'
+    >>> admin_browser.getControl("Add PPA dependency").value = (
+    ...     '~mark/ubuntu/ppa')
 
     >>> admin_browser.getControl(
     ...     "Basic (only released packages).").selected = True
@@ -557,7 +568,8 @@ PPA context page and the action won't be executed.
 
     >>> admin_browser.getLink('Edit PPA dependencies').click()
 
-    >>> admin_browser.getControl("Add PPA dependency").value = '~no-priv/ubuntu/ppa'
+    >>> admin_browser.getControl("Add PPA dependency").value = (
+    ...     '~no-priv/ubuntu/ppa')
     >>> admin_browser.getControl(
     ...     name="field.selected_dependencies").value = ['~mark/ubuntu/ppa']
     >>> admin_browser.getControl(
diff --git a/lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt b/lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt
index 536ff72..027721e 100644
--- a/lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt
+++ b/lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt
@@ -239,7 +239,8 @@ While we are there, we can also see that the private PPA's 'repository-size'
 pagelet isn't publicly available.
 
     >>> anon_browser.open(
-    ...     "http://launchpad.test/~cprov/+archive/ubuntu/p3a/+repository-size";)
+    ...     "http://launchpad.test/~cprov/+archive/ubuntu/p3a/";
+    ...     "+repository-size")
     Traceback (most recent call last):
     ...
     zope.security.interfaces.Unauthorized: (..., 'launchpad.View')
diff --git a/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt b/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt
index bcea41e..e388e89 100644
--- a/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt
+++ b/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt
@@ -142,7 +142,8 @@ when Celso clicks 'Edit/Cancel' for the Launchpad Developers subscription,
 modifies the description field and clicks Update,
 
     >>> cprov_browser.getLink(
-    ...     url='/~cprov/+archive/ubuntu/p3a/+subscriptions/launchpad/+edit').click()
+    ...     url='/~cprov/+archive/ubuntu/p3a/+subscriptions/launchpad/+edit',
+    ...     ).click()
     >>> cprov_browser.getControl(name="field.description").value = (
     ...     "a different description")
     >>> cprov_browser.getControl(name="field.actions.update").click()
@@ -175,7 +176,8 @@ when Celso clicks 'Edit/Cancel' for the Launchpad Developers subscription
 and clicks Cancel,
 
     >>> cprov_browser.getLink(
-    ...     url='/~cprov/+archive/ubuntu/p3a/+subscriptions/launchpad/+edit').click()
+    ...     url='/~cprov/+archive/ubuntu/p3a/+subscriptions/launchpad/+edit',
+    ...     ).click()
     >>> cprov_browser.getControl(name="field.actions.cancel").click()
 
 then the browser is redirected back to the subscriptions page, the canceled
diff --git a/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt b/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt
index b47dc6a..1a1c11a 100644
--- a/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt
+++ b/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt
@@ -177,7 +177,8 @@ has a signing key:
     >>> from lp.registry.interfaces.gpg import IGPGKeySet
     >>> login('foo.bar@xxxxxxxxxxxxx')
     >>> mark = getUtility(IPersonSet).getByName('mark')
-    >>> a_key = getUtility(IGPGKeySet).getByFingerprint('ABCDEF0123456789ABCDDCBA0000111112345678')
+    >>> a_key = getUtility(IGPGKeySet).getByFingerprint(
+    ...     'ABCDEF0123456789ABCDDCBA0000111112345678')
     >>> removeSecurityProxy(mark_private_ppa).signing_key_fingerprint = (
     ...     a_key.fingerprint)
     >>> removeSecurityProxy(mark_private_ppa).signing_key_owner = a_key.owner
diff --git a/lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt b/lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt
index 159f003..65cccda 100644
--- a/lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt
+++ b/lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt
@@ -465,7 +465,8 @@ An empty PPA doesn't list any packages and it also doesn't present the
 'apt sources lines ' widget and the repository 'URL' since they would
 link to a repository that doesn't exist yet.
 
-    >>> anon_browser.open("http://launchpad.test/~no-priv/+archive/ubuntu/ppa";)
+    >>> anon_browser.open(
+    ...     "http://launchpad.test/~no-priv/+archive/ubuntu/ppa";)
     >>> print(extract_text(find_main_content(anon_browser.contents)))
     PPA for No Privileges Person
     PPA description
@@ -536,12 +537,14 @@ It also has a link pointing to its corresponding help page.
 Anonymous access or users with no upload permission cannot see the
 upload hint section.
 
-    >>> anon_browser.open("http://launchpad.test/~no-priv/+archive/ubuntu/ppa";)
+    >>> anon_browser.open(
+    ...     "http://launchpad.test/~no-priv/+archive/ubuntu/ppa";)
     >>> print(find_tag_by_id(
     ...     anon_browser.contents, 'upload-hint'))
     None
 
-    >>> admin_browser.open("http://launchpad.test/~no-priv/+archive/ubuntu/ppa";)
+    >>> admin_browser.open(
+    ...     "http://launchpad.test/~no-priv/+archive/ubuntu/ppa";)
     >>> print(find_tag_by_id(
     ...     anon_browser.contents, 'upload-hint'))
     None
@@ -567,7 +570,8 @@ for more information).
 
     >>> login('foo.bar@xxxxxxxxxxxxx')
     >>> no_priv = getUtility(IPersonSet).getByName('no-priv')
-    >>> a_key = getUtility(IGPGKeySet).getByFingerprint('ABCDEF0123456789ABCDDCBA0000111112345678')
+    >>> a_key = getUtility(IGPGKeySet).getByFingerprint(
+    ...     'ABCDEF0123456789ABCDDCBA0000111112345678')
     >>> removeSecurityProxy(no_priv.archive).signing_key_fingerprint = (
     ...     a_key.fingerprint)
     >>> removeSecurityProxy(no_priv.archive).signing_key_owner = a_key.owner
diff --git a/lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt b/lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt
index c7cb750..31b4c17 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt
+++ b/lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt
@@ -10,14 +10,16 @@ according to the selected buildstate, by default All.
     ...     """Check if the label and/or the field for the optional
     ...     "names containing" search are present in the given page contents.
     ...
-    ...     Check the presence of "build_state" selection widget via assertion.
+    ...     Check the presence of "build_state" selection widget via
+    ...     assertion.
     ...
     ...     Check the presence of "Filter" submit button via assertion.
     ...
-    ...     Return "State and Name present" if the page provide both parameters,
-    ...     "State present, Name not present" if the page only permits browse
-    ...     by state and "mismatch" if the page, erroneously,  provide only
-    ...     part of the required arguments to enable filter by name.
+    ...     Return "State and Name present" if the page provide both
+    ...     parameters, "State present, Name not present" if the page only
+    ...     permits browse by state and "mismatch" if the page, erroneously,
+    ...     provide only part of the required arguments to enable filter by
+    ...     name.
     ...     """
     ...     assert six.ensure_str(
     ...         '<input type="submit" value="Filter" />') in contents
diff --git a/lib/lp/soyuz/stories/soyuz/xx-distroarchseries-binpackages.txt b/lib/lp/soyuz/stories/soyuz/xx-distroarchseries-binpackages.txt
index 8f5d03a..b7648c2 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-distroarchseries-binpackages.txt
+++ b/lib/lp/soyuz/stories/soyuz/xx-distroarchseries-binpackages.txt
@@ -175,7 +175,8 @@ Their page functionality is identical to regular packages, which is described
 in the previous section of this page.
 
     >>> browser.open(
-    ...     'http://launchpad.test/ubuntu/breezy-autotest/i386/commercialpackage')
+    ...     'http://launchpad.test/ubuntu/breezy-autotest/i386/'
+    ...     'commercialpackage')
 
 This page provides the publishing history of this BinaryPackage within
 this architecture:
diff --git a/lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt b/lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt
index 7a4ce27..c668ca7 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt
+++ b/lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt
@@ -157,7 +157,8 @@ distroseries page. We will use a small helper function to extract the
 current distroseries architecture list.
 
     >>> def check_arch_list(distroseries='warty'):
-    ...     anon_browser.open("http://launchpad.test/ubuntu/%s"; % distroseries)
+    ...     anon_browser.open(
+    ...         "http://launchpad.test/ubuntu/%s"; % distroseries)
     ...     print(extract_text(find_tag_by_id(
     ...         anon_browser.contents, 'portlet-architectures-list')))
 
diff --git a/lib/lp/soyuz/stories/soyuz/xx-person-packages.txt b/lib/lp/soyuz/stories/soyuz/xx-person-packages.txt
index c6936d2..82fcbcd 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-person-packages.txt
+++ b/lib/lp/soyuz/stories/soyuz/xx-person-packages.txt
@@ -164,7 +164,9 @@ Let's make a helper function to print the PPA packages from the page:
 Make a function to update the cached latest person source package release
 records.
 
-    >>> from lp.scripts.garbo import PopulateLatestPersonSourcePackageReleaseCache
+    >>> from lp.scripts.garbo import (
+    ...     PopulateLatestPersonSourcePackageReleaseCache,
+    ...     )
     >>> from lp.services.database.sqlbase import flush_database_updates
     >>> from lp.services.log.logger import FakeLogger
     >>> from lp.testing.dbuser import switch_dbuser
diff --git a/lib/lp/soyuz/stories/webservice/xx-archive.txt b/lib/lp/soyuz/stories/webservice/xx-archive.txt
index f045af9..42cb4a3 100644
--- a/lib/lp/soyuz/stories/webservice/xx-archive.txt
+++ b/lib/lp/soyuz/stories/webservice/xx-archive.txt
@@ -4,7 +4,8 @@ Archives
 Representations for IArchive can be fetched via the API for PPAs and
 distribution archives.
 
-    >>> cprov_archive = webservice.get("/~cprov/+archive/ubuntu/ppa").jsonBody()
+    >>> cprov_archive = webservice.get(
+    ...     "/~cprov/+archive/ubuntu/ppa").jsonBody()
     >>> print(cprov_archive['self_link'])
     http://.../~cprov/+archive/ubuntu/ppa
 
@@ -91,7 +92,8 @@ We can quickly assign a random OpenPGP key to Celso's PPA.
 
 And then the new attribute value is exported as a string.
 
-    >>> cprov_archive = webservice.get("/~cprov/+archive/ubuntu/ppa").jsonBody()
+    >>> cprov_archive = webservice.get(
+    ...     "/~cprov/+archive/ubuntu/ppa").jsonBody()
     >>> print(cprov_archive['signing_key_fingerprint'])
     ABCDEF0123456789ABCDDCBA0000111112345678
 
@@ -1190,7 +1192,8 @@ Note that the 'description' and the 'signing_key_fingerprint'
 attributes are only exposed when the requestor has View permission in
 the IArchive context, in this case only Celso has it.
 
-    >>> pprint_entry(user_webservice.get("/~cprov/+archive/ubuntu/p3a").jsonBody())
+    >>> pprint_entry(user_webservice.get(
+    ...     "/~cprov/+archive/ubuntu/p3a").jsonBody())
     authorized_size: 'tag:launchpad.net:2008:redacted'
     dependencies_collection_link:
         'http://.../~cprov/+archive/ubuntu/p3a/dependencies'
@@ -1210,7 +1213,8 @@ the IArchive context, in this case only Celso has it.
     suppress_subscription_notifications: False
     web_link: 'http://launchpad.../~cprov/+archive/ubuntu/p3a'
 
-    >>> pprint_entry(cprov_webservice.get("/~cprov/+archive/ubuntu/p3a").jsonBody())
+    >>> pprint_entry(cprov_webservice.get(
+    ...     "/~cprov/+archive/ubuntu/p3a").jsonBody())
     authorized_size: 2048
     dependencies_collection_link:
         'http://.../~cprov/+archive/ubuntu/p3a/dependencies'
@@ -1467,8 +1471,8 @@ Asking for an archive on which there is no dependency returns None.
 
 Archives will also give us a list of their custom dependencies.
 
-    >>> print_self_link_of_entries(
-    ...     webservice.get('/~cprov/+archive/ubuntu/ppa/dependencies').jsonBody())
+    >>> print_self_link_of_entries(webservice.get(
+    ...     '/~cprov/+archive/ubuntu/ppa/dependencies').jsonBody())
     http://.../~cprov/+archive/ubuntu/ppa/+dependency/1
 
 Crafting a URL to a non-dependency 404s:
diff --git a/lib/lp/soyuz/stories/webservice/xx-binary-package-publishing.txt b/lib/lp/soyuz/stories/webservice/xx-binary-package-publishing.txt
index af45f16..3529000 100644
--- a/lib/lp/soyuz/stories/webservice/xx-binary-package-publishing.txt
+++ b/lib/lp/soyuz/stories/webservice/xx-binary-package-publishing.txt
@@ -5,7 +5,8 @@ Binary Package Publishing
 Binary package publishing details are available via a custom operation on
 archives, getPublishedBinaries().
 
-    >>> cprov_archive = webservice.get("/~cprov/+archive/ubuntu/ppa").jsonBody()
+    >>> cprov_archive = webservice.get(
+    ...     "/~cprov/+archive/ubuntu/ppa").jsonBody()
     >>> pubs = webservice.named_get(
     ...     cprov_archive['self_link'], 'getPublishedBinaries').jsonBody()
 
@@ -121,7 +122,8 @@ Create a private PPA for Celso with some binaries.
 Only Celso (or anyone who participates on the PPA owner team) has
 access to the PPA publications.
 
-    >>> cprov_private_ppa = webservice.get("/~cprov/+archive/ubuntu/p3a").jsonBody()
+    >>> cprov_private_ppa = webservice.get(
+    ...     "/~cprov/+archive/ubuntu/p3a").jsonBody()
     >>> cprov_bins_response = webservice.named_get(
     ...     cprov_private_ppa['self_link'], 'getPublishedBinaries')
     >>> print(cprov_bins_response)
@@ -223,27 +225,32 @@ But other URLs result in a 404.
     ...
 
     >>> print(webservice.get(
-    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/phoenix/1.0/hppa/2010-02-23/unknown'))
+    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/phoenix/1.0/'
+    ...     'hppa/2010-02-23/unknown'))
     HTTP/1.1 404 Not Found
     ...
 
     >>> print(webservice.get(
-    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/mozilla-firefox/1.1/hppa/2010-02-23/unknown'))
+    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/mozilla-firefox/1.1/'
+    ...     'hppa/2010-02-23/unknown'))
     HTTP/1.1 404 Not Found
     ...
 
     >>> print(webservice.get(
-    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/mozilla-firefox/1.0/foo/2010-02-23/unknown'))
+    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/mozilla-firefox/1.0/'
+    ...     'foo/2010-02-23/unknown'))
     HTTP/1.1 404 Not Found
     ...
 
     >>> print(webservice.get(
-    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/mozilla-firefox/1.0/hppa/2010-02-25/unknown'))
+    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/mozilla-firefox/1.0/'
+    ...     'hppa/2010-02-25/unknown'))
     HTTP/1.1 404 Not Found
     ...
 
     >>> print(webservice.get(
-    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/mozilla-firefox/1.0/hppa/2010-02-23/XX'))
+    ...     '/~cprov/+archive/ubuntu/ppa/+binaryhits/mozilla-firefox/1.0/'
+    ...     'hppa/2010-02-23/XX'))
     HTTP/1.1 404 Not Found
     ...
 
diff --git a/lib/lp/soyuz/stories/webservice/xx-person-createppa.txt b/lib/lp/soyuz/stories/webservice/xx-person-createppa.txt
index e7aa8cb..6ec8bc8 100644
--- a/lib/lp/soyuz/stories/webservice/xx-person-createppa.txt
+++ b/lib/lp/soyuz/stories/webservice/xx-person-createppa.txt
@@ -98,8 +98,8 @@ And the PPA is, of course, private:
 It's possible to create PPAs for all sorts of distributions.
 
     >>> print(ppa_owner_webservice.named_post(
-    ...     ppa_owner['self_link'], 'createPPA', {}, distribution='/ubuntutest',
-    ...     name='ppa'))
+    ...     ppa_owner['self_link'], 'createPPA', {},
+    ...     distribution='/ubuntutest', name='ppa'))
     HTTP/1.1 201 Created
     ...
     Location: http://api.launchpad.test/.../+archive/ubuntutest/ppa
diff --git a/lib/lp/soyuz/stories/webservice/xx-source-package-publishing.txt b/lib/lp/soyuz/stories/webservice/xx-source-package-publishing.txt
index 92e2764..c75f1d6 100644
--- a/lib/lp/soyuz/stories/webservice/xx-source-package-publishing.txt
+++ b/lib/lp/soyuz/stories/webservice/xx-source-package-publishing.txt
@@ -30,7 +30,8 @@ We need to insert some dependent fake data before continuing.
     >>> cprov_webservice = webservice_for_person(
     ...     cprov_db, permission=OAuthPermission.WRITE_PUBLIC)
 
-    >>> cprov_archive = webservice.get("/~cprov/+archive/ubuntu/ppa").jsonBody()
+    >>> cprov_archive = webservice.get(
+    ...     "/~cprov/+archive/ubuntu/ppa").jsonBody()
     >>> cprov_srcs_response = pubs = webservice.named_get(
     ...     cprov_archive['self_link'], 'getPublishedSources')
     >>> pubs = cprov_srcs_response.jsonBody()
diff --git a/lib/lp/testopenid/stories/basics.txt b/lib/lp/testopenid/stories/basics.txt
index 0368d65..380bb7d 100644
--- a/lib/lp/testopenid/stories/basics.txt
+++ b/lib/lp/testopenid/stories/basics.txt
@@ -49,7 +49,8 @@ POST request.
 Get the association handle, which we will need for later tests.
 
     >>> import re
-    >>> [assoc_handle] = re.findall('assoc_handle:(.*)', anon_browser.contents)
+    >>> [assoc_handle] = re.findall(
+    ...     'assoc_handle:(.*)', anon_browser.contents)
 
 
 checkid_setup Mode
diff --git a/lib/lp/translations/doc/pofile.txt b/lib/lp/translations/doc/pofile.txt
index 4f34ad7..69a231b 100644
--- a/lib/lp/translations/doc/pofile.txt
+++ b/lib/lp/translations/doc/pofile.txt
@@ -700,7 +700,8 @@ created by a certain person.
     >>> carlos = person_set.getByName('carlos')
     >>> translationmessages = evolution_es.getTranslationsFilteredBy(carlos)
     >>> for translationmessage in translationmessages:
-    ...     print(pretty(removeSecurityProxy(translationmessage.translations)))
+    ...     print(pretty(removeSecurityProxy(
+    ...         translationmessage.translations)))
     ['libreta de direcciones de Evolution']
     ['carpeta de libretas de direcciones actual']
     ['lalalala']
diff --git a/lib/lp/translations/doc/potmsgset.txt b/lib/lp/translations/doc/potmsgset.txt
index 3f8e77e..a7a8d79 100644
--- a/lib/lp/translations/doc/potmsgset.txt
+++ b/lib/lp/translations/doc/potmsgset.txt
@@ -364,7 +364,8 @@ translations in Spanish:
     ...     evo_distro_message.getCurrentTranslation(
     ...         evo_distro_template, spanish,
     ...         evo_distro_template.translation_side))
-    >>> print(pretty(removeSecurityProxy(evo_distro_translation.translations)))
+    >>> print(pretty(removeSecurityProxy(
+    ...     evo_distro_translation.translations)))
     [' caratas']
 
     >>> suggestions = (
diff --git a/lib/lp/translations/stories/importqueue/xx-translation-import-queue-filtering.txt b/lib/lp/translations/stories/importqueue/xx-translation-import-queue-filtering.txt
index 89435b9..cdad7ca 100644
--- a/lib/lp/translations/stories/importqueue/xx-translation-import-queue-filtering.txt
+++ b/lib/lp/translations/stories/importqueue/xx-translation-import-queue-filtering.txt
@@ -11,7 +11,8 @@ is no human readable labels associated with them.
     >>> import os.path
     >>> test_file_name = os.path.join(
     ...     os.path.dirname(lp.translations.__file__),
-    ...     'stories/importqueue/xx-translation-import-queue-filtering.tar.gz')
+    ...     'stories/importqueue/'
+    ...     'xx-translation-import-queue-filtering.tar.gz')
     >>> tarball = open(test_file_name, 'rb')
 
 Our star for this session is Carlos, who has full access rights to the
diff --git a/lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt b/lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt
index 08b6f77..8c4c052 100644
--- a/lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt
+++ b/lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt
@@ -87,7 +87,8 @@ Import queue for product series
 
 The import queue is linked from the translations page for product series.
 
-    >>> user_browser.open('http://translations.launchpad.test/evolution/trunk')
+    >>> user_browser.open(
+    ...     'http://translations.launchpad.test/evolution/trunk')
     >>> user_browser.getLink('import queue').click()
 
 This time, we do have content for this product:
diff --git a/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt b/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt
index e1633ef..04ffefa 100644
--- a/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt
+++ b/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt
@@ -107,8 +107,8 @@ to where we can edit imports.
 Now, we attach a new file to an already existing translation resource.
 
     >>> browser.open(
-    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/evolution/'
-    ...     '+pots/evolution-2.2/+upload')
+    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/'
+    ...     'evolution/+pots/evolution-2.2/+upload')
     >>> upload = browser.getControl('File')
     >>> upload
     <Control name='file' type='file'>
diff --git a/lib/lp/translations/stories/navigation-links/pofile.txt b/lib/lp/translations/stories/navigation-links/pofile.txt
index 7cc026a..a69c22f 100644
--- a/lib/lp/translations/stories/navigation-links/pofile.txt
+++ b/lib/lp/translations/stories/navigation-links/pofile.txt
@@ -25,8 +25,8 @@ The Application tabs should point to IProduct URLs.
 Taking an IPOFile for ISourcePackage context:
 
     >>> admin_browser.open(
-    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/evolution/'
-    ...     '+pots/evolution-2.2/es')
+    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/'
+    ...     'evolution/+pots/evolution-2.2/es')
     >>> print(admin_browser.url)
     http://translations.launchpad.test/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/es
 
diff --git a/lib/lp/translations/stories/productseries/xx-productseries-translation-export.txt b/lib/lp/translations/stories/productseries/xx-productseries-translation-export.txt
index 337a29b..3a42faf 100644
--- a/lib/lp/translations/stories/productseries/xx-productseries-translation-export.txt
+++ b/lib/lp/translations/stories/productseries/xx-productseries-translation-export.txt
@@ -13,7 +13,8 @@ Any authenticated user can request a tarball export for a productseries.  The
 option is presented in the sidebar as "Download translations" on the
 productseries' translations page.
 
-    >>> user_browser.open('http://translations.launchpad.test/evolution/trunk/')
+    >>> user_browser.open(
+    ...     'http://translations.launchpad.test/evolution/trunk/')
     >>> user_browser.getLink('download').click()
     >>> print(user_browser.url)
     http://translations.launchpad.test/evolution/trunk/+export
@@ -35,7 +36,8 @@ Anonymous access
 To prevent spambot activity from becoming a problem, the download option is
 not available to anonymous visitors.
 
-    >>> anon_browser.open('http://translations.launchpad.test/evolution/trunk/')
+    >>> anon_browser.open(
+    ...     'http://translations.launchpad.test/evolution/trunk/')
     >>> anon_browser.getLink('download')
     Traceback (most recent call last):
     ...
@@ -92,7 +94,8 @@ Nothing to export
 Where there are no translation files to be exported, the user is not offered
 the option to download any.
 
-    >>> user_browser.open('http://translations.launchpad.test/bzr/trunk/+export')
+    >>> user_browser.open(
+    ...     'http://translations.launchpad.test/bzr/trunk/+export')
     >>> print_feedback_messages(user_browser.contents)
     There are no translations to download in Bazaar trunk series.
 
diff --git a/lib/lp/translations/stories/standalone/xx-person-editlanguages.txt b/lib/lp/translations/stories/standalone/xx-person-editlanguages.txt
index 398cd0b..d552f30 100644
--- a/lib/lp/translations/stories/standalone/xx-person-editlanguages.txt
+++ b/lib/lp/translations/stories/standalone/xx-person-editlanguages.txt
@@ -84,7 +84,8 @@ it from the browser headers.  His secondary language choice, Spanish, is
 misconfigured (the language name is not spelled in proper UTF-8) but the
 pt_br language code is recognized properly.
 
-    >>> portlet = find_tag_by_id(browser.contents, 'portlet-browser-languages')
+    >>> portlet = find_tag_by_id(
+    ...     browser.contents, 'portlet-browser-languages')
     >>> print(extract_text(portlet))
     Your browser languages:
     Portuguese (Brazil)
diff --git a/lib/lp/translations/stories/standalone/xx-pofile-details.txt b/lib/lp/translations/stories/standalone/xx-pofile-details.txt
index a54e2a7..d615ac0 100644
--- a/lib/lp/translations/stories/standalone/xx-pofile-details.txt
+++ b/lib/lp/translations/stories/standalone/xx-pofile-details.txt
@@ -93,8 +93,9 @@ was reviewed and rejected).
 Looking at the same page filtered by 'no-priv' person, the user is shown
 only a single unused suggestion instead:
 
-    >>> anon_browser.open('http://translations.launchpad.test/evolution/trunk/'
-    ...                   '+pots/evolution-2.2/es/+filter?person=no-priv')
+    >>> anon_browser.open(
+    ...     'http://translations.launchpad.test/evolution/trunk/'
+    ...     '+pots/evolution-2.2/es/+filter?person=no-priv')
     >>> print_shown_translations(anon_browser)
     english    14. The location and hierarchy of the Evolution...
      unused    2005-08-29 This is a suggestion added by a non-...
@@ -113,16 +114,18 @@ Invalid input
 
 Manually filtering by non-existent user warns the user of the problem.
 
-    >>> anon_browser.open('http://translations.launchpad.test/evolution/trunk/'
-    ...                   '+pots/evolution-2.2/es/+filter?person=danilo')
+    >>> anon_browser.open(
+    ...     'http://translations.launchpad.test/evolution/trunk/'
+    ...     '+pots/evolution-2.2/es/+filter?person=danilo')
     >>> print_feedback_messages(anon_browser.contents)
     Requested person not found.
     This person has made no contributions to this file.
 
 If a person to filter by is not specified, user is notified of that.
 
-    >>> anon_browser.open('http://translations.launchpad.test/evolution/trunk/'
-    ...                   '+pots/evolution-2.2/es/+filter')
+    >>> anon_browser.open(
+    ...     'http://translations.launchpad.test/evolution/trunk/'
+    ...     '+pots/evolution-2.2/es/+filter')
     >>> print_feedback_messages(anon_browser.contents)
     No person to filter by specified.
     This person has made no contributions to this file.
diff --git a/lib/lp/translations/stories/standalone/xx-pofile-translate-legal-warning.txt b/lib/lp/translations/stories/standalone/xx-pofile-translate-legal-warning.txt
index 3b69007..6776ae0 100644
--- a/lib/lp/translations/stories/standalone/xx-pofile-translate-legal-warning.txt
+++ b/lib/lp/translations/stories/standalone/xx-pofile-translate-legal-warning.txt
@@ -20,7 +20,9 @@ from the upstream project.
     >>> logout()
 
     >>> browser = setupBrowser(auth='Basic carlos@xxxxxxxxxxxxx:test')
-    >>> browser.open('http://translations.launchpad.test/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/es/3/+translate')
+    >>> browser.open(
+    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/'
+    ...     'evolution/+pots/evolution-2.2/es/3/+translate')
     >>> print(extract_text(find_tag_by_id(
     ...     browser.contents, 'msgset_132_es_suggestion_3_0')))
     tiene
@@ -28,6 +30,7 @@ from the upstream project.
 A warning icon about the legal situation is shown alongside the suggestion
 itself.
 
-    >>> warning_link = find_tags_by_class(browser.contents, 'legal-warning')[0]
+    >>> warning_link = find_tags_by_class(
+    ...     browser.contents, 'legal-warning')[0]
     >>> print(extract_link_from_tag(warning_link))
     https://help.launchpad.net/Translations/ReusingPackagedTranslations
diff --git a/lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt b/lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt
index 35a5fdc..ed6edf8 100644
--- a/lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt
+++ b/lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt
@@ -18,8 +18,8 @@ number of queries issued is relatively low.  Mileage may vary, but consider
 this test a tripwire for the number potentially getting out of hand.
 
     >>> anon_browser.open(
-    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/evolution/'
-    ...     '+pots/evolution-2.2/es/+translate')
+    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/'
+    ...     'evolution/+pots/evolution-2.2/es/+translate')
     >>> anon_browser.url
     'http://translations.launchpad.test/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/es/+translate'
     >>> print(anon_browser.contents)
@@ -36,8 +36,8 @@ option to make suggestions, but existing suggestions as well.  It takes more
 queries, but it still shouldn't run in the hundreds.
 
     >>> admin_browser.open(
-    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/evolution/'
-    ...     '+pots/evolution-2.2/es/+translate')
+    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/'
+    ...     'evolution/+pots/evolution-2.2/es/+translate')
     >>> admin_browser.url
     'http://translations.launchpad.test/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/es/+translate'
 
diff --git a/lib/lp/translations/stories/standalone/xx-product-export.txt b/lib/lp/translations/stories/standalone/xx-product-export.txt
index e327a81..6524e6d 100644
--- a/lib/lp/translations/stories/standalone/xx-product-export.txt
+++ b/lib/lp/translations/stories/standalone/xx-product-export.txt
@@ -17,7 +17,8 @@ currently the preferred translation target.
 Another way of getting that same export would be to browse to the series
 first and requesting a download there.
 
-    >>> user_browser.open('http://translations.launchpad.test/evolution/trunk')
+    >>> user_browser.open(
+    ...     'http://translations.launchpad.test/evolution/trunk')
     >>> user_browser.getLink('download').click()
     >>> user_browser.url
     'http://translations.launchpad.test/evolution/trunk/+export'
diff --git a/lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt b/lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt
index 04994c8..3b662b7 100644
--- a/lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt
+++ b/lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt
@@ -16,7 +16,8 @@ Mark is a qualified user.
 
     >>> browser = setupBrowser(auth='Basic mark@xxxxxxxxxxx:test')
     >>> browser.open(
-    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/mozilla/')
+    ...     'http://translations.launchpad.test/ubuntu/hoary/+source/'
+    ...     'mozilla/')
     >>> download = browser.getLink('download a full tarball')
     >>> download_url = download.url
     >>> download.click()
diff --git a/lib/lp/translations/stories/translations/xx-translations.txt b/lib/lp/translations/stories/translations/xx-translations.txt
index e212791..377a9bf 100644
--- a/lib/lp/translations/stories/translations/xx-translations.txt
+++ b/lib/lp/translations/stories/translations/xx-translations.txt
@@ -242,7 +242,8 @@ Looking at the Spanish language overview page, we can see that there are
 15 untranslated, 1 unreviewed and 1 changed in Ubuntu Evolution translations
 (all numbers repeated as hidden 'sortkey' values).
 
-    >>> browser.open('http://translations.launchpad.test/ubuntu/hoary/+lang/es')
+    >>> browser.open(
+    ...     'http://translations.launchpad.test/ubuntu/hoary/+lang/es')
     >>> evolution_line = find_tag_by_id(browser.contents, 'evolution-2.2')
     >>> print(extract_text(evolution_line))
     evolution-2.2
@@ -319,7 +320,8 @@ a random choice of an IP address for which we hold no GeoIP mappings.
 
     >>> anon_browser.addHeader('X-Forwarded-For', '255.255.255.255')
     >>> anon_browser.open(
-    ...     'http://translations.launchpad.test/evolution/trunk/+translations')
+    ...     'http://translations.launchpad.test/evolution/trunk/'
+    ...     '+translations')
     >>> find_tag_by_id(anon_browser.contents, 'legend') is None
     False
 
@@ -335,16 +337,16 @@ will again see the legend.
 The same happens for template overview page for packages.
 
     >>> anon_browser.open(
-    ...    'http://translations.launchpad.test/ubuntu/hoary/+source/evolution/'
-    ...    '+translations')
+    ...    'http://translations.launchpad.test/ubuntu/hoary/+source/'
+    ...    'evolution/+translations')
     >>> find_tag_by_id(anon_browser.contents, 'legend') is None
     True
 
 And with at least one translation, legend is shown.
 
     >>> anon_browser.open(
-    ...    'http://translations.launchpad.test/ubuntu/hoary/+source/evolution/'
-    ...    '+pots/man')
+    ...    'http://translations.launchpad.test/ubuntu/hoary/+source/'
+    ...    'evolution/+pots/man')
     >>> find_tag_by_id(anon_browser.contents, 'legend') is None
     False
 
diff --git a/lib/lp/translations/utilities/doc/gettext_po_parser.txt b/lib/lp/translations/utilities/doc/gettext_po_parser.txt
index 5b62a50..d1dd2b9 100644
--- a/lib/lp/translations/utilities/doc/gettext_po_parser.txt
+++ b/lib/lp/translations/utilities/doc/gettext_po_parser.txt
@@ -458,11 +458,13 @@ other:
 A practical example we can find on-line is that of Slovenian translations.
 Plural formula in GNOME and a preferred value is:
 
-    >>> form_1 = '(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0)'
+    >>> form_1 = (
+    ...     '(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0)')
 
 However, KDE uses the formula which returns indices shifted by one:
 
-    >>> form_2 = '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)'
+    >>> form_2 = (
+    ...     '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)')
 
 We can easily and correctly map between these:
 
diff --git a/lib/lp/translations/utilities/doc/gettext_po_parser_context.txt b/lib/lp/translations/utilities/doc/gettext_po_parser_context.txt
index 23929ec..09cffb2 100644
--- a/lib/lp/translations/utilities/doc/gettext_po_parser_context.txt
+++ b/lib/lp/translations/utilities/doc/gettext_po_parser_context.txt
@@ -120,14 +120,14 @@ To get a message with a context, we pass a context parameter.
 
 It also works for plural form messages.
 
-    >>> potmsgset = potemplate.getPOTMsgSetByMsgIDText(u'%d file',
-    ...                                                context=u'First message')
+    >>> potmsgset = potemplate.getPOTMsgSetByMsgIDText(
+    ...     u'%d file', context=u'First message')
     >>> print(potmsgset.singular_text)
     %d file
     >>> print(potmsgset.context)
     First message
-    >>> potmsgset = potemplate.getPOTMsgSetByMsgIDText(u'%d file', u'%d files',
-    ...                                                context=u'Second message')
+    >>> potmsgset = potemplate.getPOTMsgSetByMsgIDText(
+    ...     u'%d file', u'%d files', context=u'Second message')
     >>> print(potmsgset.singular_text)
     %d file
     >>> print(potmsgset.context)
@@ -234,8 +234,8 @@ If message has a context, you cannot get it without specifying the context:
 
 If you specify context, it actually works.
 
-    >>> potmsgset = potemplate.getPOTMsgSetByMsgIDText(u'%d file',
-    ...                                                context=u'First message')
+    >>> potmsgset = potemplate.getPOTMsgSetByMsgIDText(
+    ...     u'%d file', context=u'First message')
     >>> current = potmsgset.getCurrentTranslation(
     ...     potemplate, pofile.language, potemplate.translation_side)
     >>> print(pretty(current.translations))
diff --git a/lib/lp/translations/utilities/doc/pluralforms.txt b/lib/lp/translations/utilities/doc/pluralforms.txt
index 5b6ba20..c568d45 100644
--- a/lib/lp/translations/utilities/doc/pluralforms.txt
+++ b/lib/lp/translations/utilities/doc/pluralforms.txt
@@ -18,7 +18,9 @@ the number of plural forms for the considered language.
 Let's use a Serbian language as example. Here's the plural forms
 expression for Serbian:
 
-    >>> expression = 'n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2'
+    >>> expression = (
+    ...     'n%10==1 && n%100!=11 ? 0 : '
+    ...     'n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2')
 
 It's also known that Serbian has 3 plural forms.