← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/launchpad:upgrade-black-24.1.1-2024-style into launchpad:master

 

Guruprasad has proposed merging ~lgp171188/launchpad:upgrade-black-24.1.1-2024-style into launchpad:master.

Commit message:
Upgrade to black 24.1.1

This introduces the 2024 stable style.


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/459596
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:upgrade-black-24.1.1-2024-style into launchpad:master.
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index 9a38809..a59e761 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -108,3 +108,5 @@ a0cc45d527f251438cff74b4134e7a66fba42ac7
 78a72ed0e3f5be6c727f4981d6a09e978cde4b7e
 # apply black's 2023 stable style
 ee5977f514d584c64afe453ac9d2eaa0fdbc3afd
+# apply black's 2024 stable style
+b5b64683e1bb26ffef31550f8405553275690deb
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6a72ffa..05ea550 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -36,9 +36,7 @@ repos:
             |utilities/community-contributions\.py
           )$
 -   repo: https://github.com/psf/black-pre-commit-mirror
-    # Update the pinned version of black below used by
-    # blackdoc when updating this version.
-    rev: 23.10.1
+    rev: 24.1.1
     hooks:
       - id: black
         exclude: |
@@ -75,10 +73,6 @@ repos:
     -   id: blackdoc
         args: ["-l", "78"]
         exclude: ^doc/.*
-        additional_dependencies:
-          # Update this pinned version too when updating the black pre-commit
-          # hook's version above.
-          - black==23.10.1
 -   repo: https://git.launchpad.net/lp-lint-doctest
     rev: '0.5'
     hooks:
diff --git a/lib/lp/answers/browser/questiontarget.py b/lib/lp/answers/browser/questiontarget.py
index e9556fc..c34071a 100644
--- a/lib/lp/answers/browser/questiontarget.py
+++ b/lib/lp/answers/browser/questiontarget.py
@@ -919,9 +919,9 @@ class QuestionTargetPortletAnswerContacts(LaunchpadView):
             "web_link": canonical_url(self.context, rootsite="mainsite"),
             "self_link": absoluteURL(self.context, self.api_request),
         }
-        cache[
-            self.context.name + "_answer_portlet_url_data"
-        ] = context_url_data
+        cache[self.context.name + "_answer_portlet_url_data"] = (
+            context_url_data
+        )
 
 
 class QuestionTargetPortletAnswerContactsWithDetails(LaunchpadView):
diff --git a/lib/lp/answers/notification.py b/lib/lp/answers/notification.py
index 7975fdb..4c8e4ca 100644
--- a/lib/lp/answers/notification.py
+++ b/lib/lp/answers/notification.py
@@ -85,14 +85,15 @@ class QuestionNotification:
         else:
             assignee = "None"
 
-        headers[
-            "X-Launchpad-Question"
-        ] = "%s status=%s; assignee=%s; priority=%s; language=%s" % (
-            target,
-            question.status.title,
-            assignee,
-            question.priority.title,
-            question.language.code,
+        headers["X-Launchpad-Question"] = (
+            "%s status=%s; assignee=%s; priority=%s; language=%s"
+            % (
+                target,
+                question.status.title,
+                assignee,
+                question.priority.title,
+                question.language.code,
+            )
         )
         headers["Reply-To"] = "question%s@%s" % (
             self.question.id,
diff --git a/lib/lp/answers/stories/faq-edit.rst b/lib/lp/answers/stories/faq-edit.rst
index 3d047f8..6e0794d 100644
--- a/lib/lp/answers/stories/faq-edit.rst
+++ b/lib/lp/answers/stories/faq-edit.rst
@@ -61,9 +61,9 @@ click 'Save' to save their changes.
     Windows
     On Windows, ...
 
-    >>> browser.getControl(
-    ...     "Keywords"
-    ... ).value = "windows ubuntu plugins extensions"
+    >>> browser.getControl("Keywords").value = (
+    ...     "windows ubuntu plugins extensions"
+    ... )
     >>> browser.getControl(
     ...     "Content"
     ... ).value += "\nUbuntu:\nSee https://help.ubuntu.com/community/Java\n";
diff --git a/lib/lp/answers/stories/project-add-question.rst b/lib/lp/answers/stories/project-add-question.rst
index 9cc84e6..fd1638d 100644
--- a/lib/lp/answers/stories/project-add-question.rst
+++ b/lib/lp/answers/stories/project-add-question.rst
@@ -111,9 +111,9 @@ submits the form.
     >>> print(user_browser.getControl("Project").displayValue)
     ['Mozilla Thunderbird']
 
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Problem displaying complex SVG"
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Problem displaying complex SVG"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 The user is again shown similar questions, this time for the product
@@ -272,9 +272,9 @@ because Japanese is not listed as supported. They submits the form with
 the 'Continue' button without setting the product. In this case, they are
 asking a question for Firefox in English regarding SVG.
 
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Problem displaying complex SVG"
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Problem displaying complex SVG"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 They're shown a list of similar questions related to the product Firefox.
@@ -323,9 +323,9 @@ Language, and 'Continues' to the next page.
     >>> print(user_browser.getControl("Language").displayOptions)
     ['English (en) *', 'Japanese (ja)']
 
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Problem displaying complex SVG"
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Problem displaying complex SVG"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 The product Thunderbird that they selected on the previous screen is still
@@ -346,12 +346,12 @@ Question' button.
     ['Mozilla Thunderbird']
 
     >>> user_browser.getControl("Japanese (ja) *").selected = True
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Pretend this is written in Japanese"
-    >>> user_browser.getControl(
-    ...     "Description"
-    ... ).value = "Something in kanji and hiragana."
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Pretend this is written in Japanese"
+    ... )
+    >>> user_browser.getControl("Description").value = (
+    ...     "Something in kanji and hiragana."
+    ... )
     >>> user_browser.getControl("Post Question").click()
 
 The user is taken to page displaying their question. Changing the language
diff --git a/lib/lp/answers/stories/question-add-in-other-languages.rst b/lib/lp/answers/stories/question-add-in-other-languages.rst
index f80fb81..990be5e 100644
--- a/lib/lp/answers/stories/question-add-in-other-languages.rst
+++ b/lib/lp/answers/stories/question-add-in-other-languages.rst
@@ -33,9 +33,9 @@ a language that is not spoken/understood by any of the context's answer
 contacts.
 
     >>> browser.getControl("Language").value = ["pt_BR"]
-    >>> browser.getControl(
-    ...     "Summary"
-    ... ).value = "Abrir uma pagina que requer java quebra o firefox"
+    >>> browser.getControl("Summary").value = (
+    ...     "Abrir uma pagina que requer java quebra o firefox"
+    ... )
     >>> browser.getControl("Continue").click()
 
 At this point we'll present any similar questions (in any language)
@@ -145,12 +145,12 @@ If they change the language to another unsupported language, we will
 display the warning again.
 
     >>> browser.getControl("Language").value = ["ja"]
-    >>> browser.getControl(
-    ...     "Summary"
-    ... ).value = "\u52a9\u3051\u306e\u8981\u6c42".encode("utf-8")
-    >>> browser.getControl(
-    ...     "Description"
-    ... ).value = "\u3042\u308b\u4efb\u610f\u5358\u8a9e\u3002".encode("utf-8")
+    >>> browser.getControl("Summary").value = (
+    ...     "\u52a9\u3051\u306e\u8981\u6c42".encode("utf-8")
+    ... )
+    >>> browser.getControl("Description").value = (
+    ...     "\u3042\u308b\u4efb\u610f\u5358\u8a9e\u3002".encode("utf-8")
+    ... )
     >>> browser.getControl("Post Question").click()
 
     >>> for tag in find_tags_by_class(browser.contents, "warning message"):
diff --git a/lib/lp/answers/stories/question-add.rst b/lib/lp/answers/stories/question-add.rst
index 3723f10..82784c8 100644
--- a/lib/lp/answers/stories/question-add.rst
+++ b/lib/lp/answers/stories/question-add.rst
@@ -73,9 +73,9 @@ XXX: Original search, disabled due to performance issues RBC 20100725. This
 will be reinstated when cheap relevance filtering is available / when search
 is overhauled.
 
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Visiting a web page requiring java crashes firefox"
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Visiting a web page requiring java crashes firefox"
+    ... )
 
 For now, use a closer search:
 
@@ -156,13 +156,13 @@ first step:
 Entering a valid title and description will create the new question and
 redirect the user to the question page.
 
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Visiting a web page requiring java crashes firefox"
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Visiting a web page requiring java crashes firefox"
+    ... )
     >>> user_browser.getControl("Continue").click()
-    >>> user_browser.getControl(
-    ...     "Description"
-    ... ).value = "I use Ubuntu on AMD64 and firefox is slow."
+    >>> user_browser.getControl("Description").value = (
+    ...     "I use Ubuntu on AMD64 and firefox is slow."
+    ... )
     >>> user_browser.getControl("Post Question").click()
     >>> user_browser.url
     '.../ubuntu/+source/mozilla-firefox/+question/...'
diff --git a/lib/lp/answers/stories/question-browse-and-search.rst b/lib/lp/answers/stories/question-browse-and-search.rst
index 61cc8cf..92a24fe 100644
--- a/lib/lp/answers/stories/question-browse-and-search.rst
+++ b/lib/lp/answers/stories/question-browse-and-search.rst
@@ -416,9 +416,9 @@ They need to login to access that page:
 Their problem was about integrating their email client in firefox, so they
 enter 'email client in firefox'
 
-    >>> sample_person_browser.getControl(
-    ...     name="field.search_text"
-    ... ).value = "email client in firefox"
+    >>> sample_person_browser.getControl(name="field.search_text").value = (
+    ...     "email client in firefox"
+    ... )
 
 They also remember that their question was answered, so they unselect the
 other statuses and hit the search button.
@@ -496,9 +496,9 @@ They need to login to access that page:
 
 Like all other report, this one is searchable:
 
-    >>> sample_person_browser.getControl(
-    ...     name="field.search_text"
-    ... ).value = "evolution"
+    >>> sample_person_browser.getControl(name="field.search_text").value = (
+    ...     "evolution"
+    ... )
     >>> sample_person_browser.getControl("Search", index=0).click()
     >>> print(sample_person_browser.title)
     Questions matching "evolution" needing your attention for Ubuntu :
diff --git a/lib/lp/answers/stories/question-edit.rst b/lib/lp/answers/stories/question-edit.rst
index d1db512..bd0f8d5 100644
--- a/lib/lp/answers/stories/question-edit.rst
+++ b/lib/lp/answers/stories/question-edit.rst
@@ -75,18 +75,18 @@ Any logged in user can change the question source package on the
 
     >>> user_browser.open("http://launchpad.test/ubuntu/+question/5";)
     >>> user_browser.getLink("Edit question").click()
-    >>> user_browser.getControl(
-    ...     name="field.target.package"
-    ... ).value = "linux-source-2.6.15"
+    >>> user_browser.getControl(name="field.target.package").value = (
+    ...     "linux-source-2.6.15"
+    ... )
     >>> user_browser.getControl("Save Changes").click()
 
 Product questions ignore sourcepackage information if it is submitted:
 
     >>> user_browser.open("http://launchpad.test/firefox/+question/2";)
     >>> user_browser.getLink("Edit question").click()
-    >>> user_browser.getControl(
-    ...     name="field.target.package"
-    ... ).value = "linux-source-2.6.15"
+    >>> user_browser.getControl(name="field.target.package").value = (
+    ...     "linux-source-2.6.15"
+    ... )
     >>> user_browser.getControl("Save Changes").click()
 
 
diff --git a/lib/lp/answers/stories/question-obfuscation.rst b/lib/lp/answers/stories/question-obfuscation.rst
index 791728c..66af75c 100644
--- a/lib/lp/answers/stories/question-obfuscation.rst
+++ b/lib/lp/answers/stories/question-obfuscation.rst
@@ -78,9 +78,9 @@ description. They can then see the email address in the tooltip in the
 
     >>> user_browser.getControl("Summary").value = "email address test"
     >>> user_browser.getControl("Continue").click()
-    >>> user_browser.getControl(
-    ...     "Description"
-    ... ).value = "The clicking mailto:user@xxxxxxxxxx crashes the browser."
+    >>> user_browser.getControl("Description").value = (
+    ...     "The clicking mailto:user@xxxxxxxxxx crashes the browser."
+    ... )
     >>> user_browser.getControl("Post Question").click()
     >>> print(user_browser.title)
     Question #... : ...
diff --git a/lib/lp/answers/stories/question-reject-and-change-status.rst b/lib/lp/answers/stories/question-reject-and-change-status.rst
index 7cc0805..bcb1f63 100644
--- a/lib/lp/answers/stories/question-reject-and-change-status.rst
+++ b/lib/lp/answers/stories/question-reject-and-change-status.rst
@@ -47,9 +47,9 @@ cancel link to take them back to the question:
 Entering an explanation message and clicking the 'Reject' button,
 will reject the question.
 
-    >>> admin_browser.getControl(
-    ...     "Message"
-    ... ).value = """Rejecting because it's a duplicate of bug #1."""
+    >>> admin_browser.getControl("Message").value = (
+    ...     """Rejecting because it's a duplicate of bug #1."""
+    ... )
     >>> admin_browser.getControl("Reject").click()
 
 Once the question is rejected, a confirmation message is shown;
diff --git a/lib/lp/answers/stories/question-workflow.rst b/lib/lp/answers/stories/question-workflow.rst
index 73f604f..0befd76 100755
--- a/lib/lp/answers/stories/question-workflow.rst
+++ b/lib/lp/answers/stories/question-workflow.rst
@@ -74,9 +74,7 @@ on the 'Add Information Request' button.
     Link to a FAQ
     Create a new FAQ
 
-    >>> support_browser.getControl(
-    ...     "Message"
-    ... ).value = (
+    >>> support_browser.getControl("Message").value = (
     ...     "Can you provide an example of an URL displaying the problem?"
     ... )
     >>> support_browser.getControl("Add Information Request").click()
@@ -106,9 +104,7 @@ A comment can be added at any point without altering the status. The
 user simply enters the comment in the 'Message' box and clicks the 'Just
 Add a Comment' button.
 
-    >>> support_browser.getControl(
-    ...     "Message"
-    ... ).value = (
+    >>> support_browser.getControl("Message").value = (
     ...     "I forgot to mention, in the meantime here is a workaround..."
     ... )
     >>> support_browser.getControl("Just Add a Comment").click()
@@ -260,9 +256,9 @@ When the question is Solved, it is still possible to add comments to it.
 The user simply enters the comment in the 'Message' box and clicks the
 'Just Add a Comment' button.
 
-    >>> owner_browser.getControl(
-    ...     "Message"
-    ... ).value = "The example now displays correctly. Thanks."
+    >>> owner_browser.getControl("Message").value = (
+    ...     "The example now displays correctly. Thanks."
+    ... )
     >>> owner_browser.getControl("Just Add a Comment").click()
 
 This appends the comment to the question and it doesn't change its
@@ -457,9 +453,7 @@ choosing an answer that helped him solve his problem.
     >>> answer_button_paragraph is None
     True
 
-    >>> carlos_browser.getControl(
-    ...     "Message"
-    ... ).value = (
+    >>> carlos_browser.getControl("Message").value = (
     ...     "There is a bug in that version. SMP is fine after upgrading."
     ... )
     >>> carlos_browser.getControl("Problem Solved").click()
diff --git a/lib/lp/answers/stories/this-is-a-faq.rst b/lib/lp/answers/stories/this-is-a-faq.rst
index 1ccb2ba..d2b2f09 100644
--- a/lib/lp/answers/stories/this-is-a-faq.rst
+++ b/lib/lp/answers/stories/this-is-a-faq.rst
@@ -177,9 +177,9 @@ question's title are displayed:
 
 They change the message and click 'Link to FAQ'.
 
-    >>> user_browser.getControl(
-    ...     "Message"
-    ... ).value = "Sorry, this document doesn't really answer your question."
+    >>> user_browser.getControl("Message").value = (
+    ...     "Sorry, this document doesn't really answer your question."
+    ... )
     >>> user_browser.getControl("Link to FAQ").click()
 
 But since they forgot to change the link, the form is displayed again
@@ -274,9 +274,9 @@ edit them to be more appropriate:
     Hi! I'm trying to learn about SVG but I can't get it to work at all in
     firefox. Maybe there is a plugin? Help! Thanks.
 
-    >>> owner_browser.getControl(
-    ...     "Content"
-    ... ).value = "Upgrade your browser to Firefox 2.0."
+    >>> owner_browser.getControl("Content").value = (
+    ...     "Upgrade your browser to Firefox 2.0."
+    ... )
 
 They can also enter keywords describing the FAQ:
 
diff --git a/lib/lp/app/browser/tales.py b/lib/lp/app/browser/tales.py
index 99e0e5d..c91b890 100644
--- a/lib/lp/app/browser/tales.py
+++ b/lib/lp/app/browser/tales.py
@@ -1649,7 +1649,6 @@ class DistroSeriesFormatterAPI(CustomizableFormatter):
 
 
 class SourcePackageReleaseFormatterAPI(CustomizableFormatter):
-
     """Adapter for ISourcePackageRelease objects to a formatted string."""
 
     _link_summary_template = "%(sourcepackage)s %(version)s"
diff --git a/lib/lp/app/widgets/project.py b/lib/lp/app/widgets/project.py
index 2547094..6723b5b 100644
--- a/lib/lp/app/widgets/project.py
+++ b/lib/lp/app/widgets/project.py
@@ -68,9 +68,9 @@ class ProjectScopeWidget(BrowserWidget, InputWidget):
             ):
                 attributes["checked"] = "checked"
             if option == "project":
-                attributes[
-                    "onclick"
-                ] = "document.getElementById('field.scope.target').focus();"
+                attributes["onclick"] = (
+                    "document.getElementById('field.scope.target').focus();"
+                )
             self.options[option] = renderElement("input", **attributes)
         self.target_widget.onKeyPress = (
             "selectWidget('%s.option.project', event)" % self.name
diff --git a/lib/lp/archivepublisher/domination.py b/lib/lp/archivepublisher/domination.py
index b8a8eeb..e824f4d 100644
--- a/lib/lp/archivepublisher/domination.py
+++ b/lib/lp/archivepublisher/domination.py
@@ -518,9 +518,9 @@ class Dominator:
         # the items so that we can be sure that we're not altering the
         # iteration order while iteration is underway.
         for (name, location), pubs in list(pubs_by_name_and_location.items()):
-            pubs_by_name_and_location[
-                (name, location)
-            ] = generalization.sortPublications(pubs)
+            pubs_by_name_and_location[(name, location)] = (
+                generalization.sortPublications(pubs)
+            )
 
         return pubs_by_name_and_location
 
@@ -589,9 +589,11 @@ class Dominator:
                 Not(
                     IsDistinctFrom(
                         BinaryPackagePublishingHistory._channel,
-                        Cast(json.dumps(pub_record._channel), "jsonb")
-                        if pub_record._channel is not None
-                        else None,
+                        (
+                            Cast(json.dumps(pub_record._channel), "jsonb")
+                            if pub_record._channel is not None
+                            else None
+                        ),
                     )
                 ),
             )
diff --git a/lib/lp/archivepublisher/model/ftparchive.py b/lib/lp/archivepublisher/model/ftparchive.py
index 94885ea..26eb048 100644
--- a/lib/lp/archivepublisher/model/ftparchive.py
+++ b/lib/lp/archivepublisher/model/ftparchive.py
@@ -982,9 +982,9 @@ class FTPArchiveHandler:
                 "DISTS": os.path.basename(self._config.distsroot),
                 "HIDEEXTRA": "",
                 # Must match DdtpTarballUpload.shouldInstall.
-                "LONGDESCRIPTION": "true"
-                if include_long_descriptions
-                else "false",
+                "LONGDESCRIPTION": (
+                    "true" if include_long_descriptions else "false"
+                ),
             }
         )
 
diff --git a/lib/lp/archivepublisher/tests/test_publisher.py b/lib/lp/archivepublisher/tests/test_publisher.py
index 70c9c70..e72b7c9 100644
--- a/lib/lp/archivepublisher/tests/test_publisher.py
+++ b/lib/lp/archivepublisher/tests/test_publisher.py
@@ -1492,13 +1492,13 @@ class TestPublisher(TestPublisherBase):
         archive_file = self.factory.makeArchiveFile(archive=archive)
         self.assertNotIn(archive, ubuntu.getPendingPublicationPPAs())
         now = datetime.now(timezone.utc)
-        removeSecurityProxy(
-            archive_file
-        ).scheduled_deletion_date = now + timedelta(hours=12)
+        removeSecurityProxy(archive_file).scheduled_deletion_date = (
+            now + timedelta(hours=12)
+        )
         self.assertNotIn(archive, ubuntu.getPendingPublicationPPAs())
-        removeSecurityProxy(
-            archive_file
-        ).scheduled_deletion_date = now - timedelta(hours=12)
+        removeSecurityProxy(archive_file).scheduled_deletion_date = (
+            now - timedelta(hours=12)
+        )
         self.assertIn(archive, ubuntu.getPendingPublicationPPAs())
         getUtility(IArchiveFileSet).markDeleted([archive_file])
         self.assertNotIn(archive, ubuntu.getPendingPublicationPPAs())
@@ -3003,9 +3003,9 @@ class TestArchiveIndices(TestPublisherBase):
 
         # Override the series status to FROZEN, which allows publication
         # of all pockets.
-        self.ubuntutest.getSeries(
-            "breezy-autotest"
-        ).status = SeriesStatus.FROZEN
+        self.ubuntutest.getSeries("breezy-autotest").status = (
+            SeriesStatus.FROZEN
+        )
 
         self.config = getPubConfig(self.ubuntutest.main_archive)
         publisher = Publisher(
diff --git a/lib/lp/archiveuploader/tests/upload-karma.rst b/lib/lp/archiveuploader/tests/upload-karma.rst
index d31108c..0ad5210 100644
--- a/lib/lp/archiveuploader/tests/upload-karma.rst
+++ b/lib/lp/archiveuploader/tests/upload-karma.rst
@@ -55,9 +55,9 @@ Poke the queue entry so it looks like Foo Bar (name16) uploaded it:
     >>> name16 = getUtility(IPersonSet).getByName("name16")
     >>> key = getUtility(IGPGKeySet).getGPGKeysForPerson(name16)[0]
     >>> removeSecurityProxy(foo_src.queue_root).signing_key_owner = key.owner
-    >>> removeSecurityProxy(
-    ...     foo_src.queue_root
-    ... ).signing_key_fingerprint = key.fingerprint
+    >>> removeSecurityProxy(foo_src.queue_root).signing_key_fingerprint = (
+    ...     key.fingerprint
+    ... )
     >>> transaction.commit()
     >>> foo_src.queue_root.acceptFromQueue()
     Karma added: action=distributionuploadaccepted, distribution=ubuntu
diff --git a/lib/lp/archiveuploader/uploadprocessor.py b/lib/lp/archiveuploader/uploadprocessor.py
index 562f7a4..baa903b 100644
--- a/lib/lp/archiveuploader/uploadprocessor.py
+++ b/lib/lp/archiveuploader/uploadprocessor.py
@@ -605,7 +605,6 @@ class UserUploadHandler(UploadHandler):
 
 
 class CannotGetBuild(Exception):
-
     """Attempting to retrieve the build for this upload failed."""
 
 
diff --git a/lib/lp/blueprints/stories/blueprints/xx-creation.rst b/lib/lp/blueprints/stories/blueprints/xx-creation.rst
index e5e1e91..0225661 100644
--- a/lib/lp/blueprints/stories/blueprints/xx-creation.rst
+++ b/lib/lp/blueprints/stories/blueprints/xx-creation.rst
@@ -676,12 +676,12 @@ produces the same error:
     >>> user_browser.open(url)
     >>> user_browser.getControl("For").value = "ubuntu"
     >>> user_browser.getControl("Name").value = "media-integrity-check"
-    >>> user_browser.getControl(
-    ...     "Title"
-    ... ).value = "A blueprint with a name that already exists"
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "There is already a blueprint with this name"
+    >>> user_browser.getControl("Title").value = (
+    ...     "A blueprint with a name that already exists"
+    ... )
+    >>> user_browser.getControl("Summary").value = (
+    ...     "There is already a blueprint with this name"
+    ... )
     >>> user_browser.getControl("Register Blueprint").click()
     >>> print(user_browser.url)
     http://blueprints.launchpad.test/sprints/rome/+addspec
diff --git a/lib/lp/blueprints/stories/blueprints/xx-dependencies.rst b/lib/lp/blueprints/stories/blueprints/xx-dependencies.rst
index 8a6ee9b..14837d5 100644
--- a/lib/lp/blueprints/stories/blueprints/xx-dependencies.rst
+++ b/lib/lp/blueprints/stories/blueprints/xx-dependencies.rst
@@ -64,9 +64,9 @@ minds.
 Now, lets POST the form, saying we want extension-manager-upgrades as the
 dependency.
 
-    >>> owner_browser.getControl(
-    ...     "Depends On"
-    ... ).value = "extension-manager-upgrades"
+    >>> owner_browser.getControl("Depends On").value = (
+    ...     "extension-manager-upgrades"
+    ... )
     >>> owner_browser.getControl("Continue").click()
     >>> owner_browser.url
     'http://blueprints.launchpad.test/firefox/+spec/canvas'
@@ -142,9 +142,9 @@ show this, we register a blueprint for a different project.
     ... )
     >>> owner_browser.getControl("Name").value = "test-blueprint"
     >>> owner_browser.getControl("Title").value = "Test Blueprint"
-    >>> owner_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Another blueprint in a different project"
+    >>> owner_browser.getControl("Summary").value = (
+    ...     "Another blueprint in a different project"
+    ... )
     >>> owner_browser.getControl("Register Blueprint").click()
     >>> owner_browser.url
     'http://blueprints.launchpad.test/jokosher/+spec/test-blueprint'
@@ -289,21 +289,21 @@ We create two blueprints in `ubuntu`.
     >>> owner_browser.open("http://blueprints.launchpad.test/ubuntu/+addspec";)
     >>> owner_browser.getControl("Name").value = "distro-blueprint-a"
     >>> owner_browser.getControl("Title").value = "A blueprint for a distro"
-    >>> owner_browser.getControl(
-    ...     "Summary"
-    ... ).value = "This is a blueprint for the Ubuntu distribution"
+    >>> owner_browser.getControl("Summary").value = (
+    ...     "This is a blueprint for the Ubuntu distribution"
+    ... )
     >>> owner_browser.getControl("Register Blueprint").click()
     >>> print(owner_browser.url)
     http://blueprints.launchpad.test/ubuntu/+spec/distro-blueprint-a
 
     >>> owner_browser.open("http://blueprints.launchpad.test/ubuntu/+addspec";)
     >>> owner_browser.getControl("Name").value = "distro-blueprint-b"
-    >>> owner_browser.getControl(
-    ...     "Title"
-    ... ).value = "Another blueprint for a distro"
-    >>> owner_browser.getControl(
-    ...     "Summary"
-    ... ).value = "This is a blueprint for the Ubuntu distribution"
+    >>> owner_browser.getControl("Title").value = (
+    ...     "Another blueprint for a distro"
+    ... )
+    >>> owner_browser.getControl("Summary").value = (
+    ...     "This is a blueprint for the Ubuntu distribution"
+    ... )
     >>> owner_browser.getControl("Register Blueprint").click()
     >>> print(owner_browser.url)
     http://blueprints.launchpad.test/ubuntu/+spec/distro-blueprint-b
diff --git a/lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst b/lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst
index 4ac3734..0b36cd4 100644
--- a/lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst
+++ b/lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst
@@ -19,9 +19,9 @@ Then we try to add a specification to that distro
 
     >>> user_browser.getControl("Name").value = "testspec"
     >>> user_browser.getControl("Title").value = "Test Specification"
-    >>> user_browser.getControl(
-    ...     "Specification URL"
-    ... ).value = "http://wiki.test.com";
+    >>> user_browser.getControl("Specification URL").value = (
+    ...     "http://wiki.test.com";
+    ... )
     >>> user_browser.getControl("Summary").value = "TEst spec add"
     >>> user_browser.getControl("Definition Status").value = ["NEW"]
     >>> user_browser.getControl("Assignee").value = "test@xxxxxxxxxxxxx"
diff --git a/lib/lp/blueprints/stories/blueprints/xx-editing.rst b/lib/lp/blueprints/stories/blueprints/xx-editing.rst
index 79b0d3e..89c8197 100644
--- a/lib/lp/blueprints/stories/blueprints/xx-editing.rst
+++ b/lib/lp/blueprints/stories/blueprints/xx-editing.rst
@@ -49,9 +49,9 @@ Now, let's POST the resulting changes. We should be redirected to the
 specification home page.
 
     >>> browser.getControl("Name").value = "extension-manager-upgrades"
-    >>> browser.getControl(
-    ...     "Title"
-    ... ).value = "Extension Manager System Upgrades"
+    >>> browser.getControl("Title").value = (
+    ...     "Extension Manager System Upgrades"
+    ... )
     >>> browser.getControl("Specification URL").value = url
     >>> summary = (
     ...     "Simplify the way extensions are installed and registered "
diff --git a/lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst b/lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst
index fcee09c..ea07b5b 100644
--- a/lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst
+++ b/lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst
@@ -4,9 +4,9 @@ Non-ascii characters in specification titles are allowed.
     ...     "http://blueprints.launchpad.test/firefox/+spec/e4x/+edit";
     ... )
 
-    >>> admin_browser.getControl(
-    ...     "Title"
-    ... ).value = "A title with non-ascii characters \xe1\xe3"
+    >>> admin_browser.getControl("Title").value = (
+    ...     "A title with non-ascii characters \xe1\xe3"
+    ... )
     >>> admin_browser.getControl("Change").click()
     >>> admin_browser.url
     'http://blueprints.launchpad.test/firefox/+spec/e4x'
diff --git a/lib/lp/blueprints/stories/sprints/xx-sprints.rst b/lib/lp/blueprints/stories/sprints/xx-sprints.rst
index 66f9ce6..8c74ef4 100644
--- a/lib/lp/blueprints/stories/sprints/xx-sprints.rst
+++ b/lib/lp/blueprints/stories/sprints/xx-sprints.rst
@@ -63,12 +63,12 @@ First we'll test the name field validator.
     >>> user_browser.getControl("Driver").value = "kamion"
     >>> user_browser.getControl("Home Page").value = "http://www.willy.net";
     >>> user_browser.getControl("Timezone").value = ["UTC"]
-    >>> user_browser.getControl(
-    ...     "Starting Date and Time"
-    ... ).value = "10 Oct 2006 09:15"
-    >>> user_browser.getControl(
-    ...     "Finishing Date and Time"
-    ... ).value = "13 Oct 2006 16:00"
+    >>> user_browser.getControl("Starting Date and Time").value = (
+    ...     "10 Oct 2006 09:15"
+    ... )
+    >>> user_browser.getControl("Finishing Date and Time").value = (
+    ...     "13 Oct 2006 16:00"
+    ... )
     >>> user_browser.getControl("Add Sprint").click()
 
     >>> for tag in find_tags_by_class(user_browser.contents, "message"):
@@ -95,12 +95,12 @@ Create a new sprint with a finish date before the starting date returns
 a error message.
 
     >>> user_browser.getControl("Name").value = "ltsponsteroids"
-    >>> user_browser.getControl(
-    ...     "Starting Date and Time"
-    ... ).value = "13 Oct 2006 09:15 "
-    >>> user_browser.getControl(
-    ...     "Finishing Date and Time"
-    ... ).value = "10 Oct 2006 16:00"
+    >>> user_browser.getControl("Starting Date and Time").value = (
+    ...     "13 Oct 2006 09:15 "
+    ... )
+    >>> user_browser.getControl("Finishing Date and Time").value = (
+    ...     "10 Oct 2006 16:00"
+    ... )
     >>> user_browser.getControl("Add Sprint").click()
 
     >>> for tag in find_tags_by_class(user_browser.contents, "message"):
@@ -122,12 +122,12 @@ minutes rather than second-level accuracy:
 Fix the date and try again. We're redirected to the sprint home page for
 the new sprint.
 
-    >>> user_browser.getControl(
-    ...     "Starting Date and Time"
-    ... ).value = "10 Oct 2006 09:15 "
-    >>> user_browser.getControl(
-    ...     "Finishing Date and Time"
-    ... ).value = "13 Oct 2006 16:00"
+    >>> user_browser.getControl("Starting Date and Time").value = (
+    ...     "10 Oct 2006 09:15 "
+    ... )
+    >>> user_browser.getControl("Finishing Date and Time").value = (
+    ...     "13 Oct 2006 16:00"
+    ... )
     >>> user_browser.getControl(
     ...     "Is the sprint being held in a physical " "location?"
     ... ).selected = False
@@ -161,12 +161,12 @@ Add a new sprint with a different time zone is also handled correctly.
     >>> user_browser.getControl("Summary").value = summary
     >>> user_browser.getControl("Home Page").value = "http://www.ubuntu.com";
     >>> user_browser.getControl("Timezone").value = ["Africa/Johannesburg"]
-    >>> user_browser.getControl(
-    ...     "Starting Date and Time"
-    ... ).value = "10 Jul 2006 09:15"
-    >>> user_browser.getControl(
-    ...     "Finishing Date and Time"
-    ... ).value = "13 Jul 2006 16:00"
+    >>> user_browser.getControl("Starting Date and Time").value = (
+    ...     "10 Jul 2006 09:15"
+    ... )
+    >>> user_browser.getControl("Finishing Date and Time").value = (
+    ...     "13 Jul 2006 16:00"
+    ... )
     >>> user_browser.getControl("Add Sprint").click()
 
     >>> user_browser.url
@@ -236,12 +236,12 @@ We fix the dates and change the address, we expect to be redirected to the
 sprint home page.
 
     >>> browser.getControl("Timezone").value = ["America/Toronto"]
-    >>> browser.getControl(
-    ...     "Starting Date and Time"
-    ... ).value = "2006-01-10 08:30"
-    >>> browser.getControl(
-    ...     "Finishing Date and Time"
-    ... ).value = "2006-02-12 17:00"
+    >>> browser.getControl("Starting Date and Time").value = (
+    ...     "2006-01-10 08:30"
+    ... )
+    >>> browser.getControl("Finishing Date and Time").value = (
+    ...     "2006-02-12 17:00"
+    ... )
     >>> browser.getControl("Meeting Address").value = address
     >>> browser.getControl("Change").click()
 
@@ -457,9 +457,9 @@ Sample Person registers Salgado as well.
     >>> browser.url
     'http://launchpad.test/sprints/ubz/+register'
 
-    >>> browser.getControl(
-    ...     "Attendee"
-    ... ).value = "guilherme.salgado@xxxxxxxxxxxxx"
+    >>> browser.getControl("Attendee").value = (
+    ...     "guilherme.salgado@xxxxxxxxxxxxx"
+    ... )
     >>> browser.getControl(name="field.is_physical").value = ["no"]
     >>> browser.getControl("Register").click()
 
diff --git a/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst b/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst
index d1790b5..9148ba5 100644
--- a/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst
+++ b/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst
@@ -21,9 +21,9 @@ We register a new blueprint.
     ... )
     >>> user_browser.getControl("Name").value = "informational-blueprint"
     >>> user_browser.getControl("Title").value = "Informational blueprint"
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "A blueprint requiring no implementation."
+    >>> user_browser.getControl("Summary").value = (
+    ...     "A blueprint requiring no implementation."
+    ... )
     >>> user_browser.getControl("Register Blueprint").click()
     >>> user_browser.url
     'http://blueprints.launchpad.test/jokosher/+spec/informational-blueprint'
diff --git a/lib/lp/blueprints/tests/test_specification.py b/lib/lp/blueprints/tests/test_specification.py
index c0ff34a..4e40eac 100644
--- a/lib/lp/blueprints/tests/test_specification.py
+++ b/lib/lp/blueprints/tests/test_specification.py
@@ -799,9 +799,9 @@ class TestSpecifications(TestCaseWithFactory):
         )
         if priority is not None:
             removeSecurityProxy(blueprint).priority = priority
-        removeSecurityProxy(
-            blueprint
-        ).datecreated = self.date_created + timedelta(date_created)
+        removeSecurityProxy(blueprint).datecreated = (
+            self.date_created + timedelta(date_created)
+        )
         return blueprint
 
     def test_specifications_quantity(self):
diff --git a/lib/lp/bugs/browser/bug.py b/lib/lp/bugs/browser/bug.py
index 9cbd9a4..39341c5 100644
--- a/lib/lp/bugs/browser/bug.py
+++ b/lib/lp/bugs/browser/bug.py
@@ -1050,12 +1050,12 @@ class BugSecrecyEditView(LaunchpadFormView, BugSubscriptionPortletDetails):
 
             if changed:
                 result_data = self._getSubscriptionDetails()
-                result_data[
-                    "can_add_project_task"
-                ] = can_add_project_task_to_bug(bug)
-                result_data[
-                    "can_add_package_task"
-                ] = can_add_package_task_to_bug(bug)
+                result_data["can_add_project_task"] = (
+                    can_add_project_task_to_bug(bug)
+                )
+                result_data["can_add_package_task"] = (
+                    can_add_package_task_to_bug(bug)
+                )
                 self.request.response.setHeader(
                     "content-type", "application/json"
                 )
diff --git a/lib/lp/bugs/browser/buglisting.py b/lib/lp/bugs/browser/buglisting.py
index 3b579c7..f6aebfd 100644
--- a/lib/lp/bugs/browser/buglisting.py
+++ b/lib/lp/bugs/browser/buglisting.py
@@ -1116,12 +1116,12 @@ class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin):
             cache.objects.update(
                 get_batch_properties_for_json_cache(self, batch_navigator)
             )
-            cache.objects[
-                "field_visibility"
-            ] = batch_navigator.field_visibility
-            cache.objects[
-                "field_visibility_defaults"
-            ] = batch_navigator.field_visibility_defaults
+            cache.objects["field_visibility"] = (
+                batch_navigator.field_visibility
+            )
+            cache.objects["field_visibility_defaults"] = (
+                batch_navigator.field_visibility_defaults
+            )
             cache.objects["cbl_cookie_name"] = batch_navigator.getCookieName()
 
             cache.objects["order_by"] = ",".join(
@@ -1240,9 +1240,9 @@ class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin):
         """Customize the onKeyPress event of the assignee chooser."""
         LaunchpadFormView.setUpWidgets(self)
 
-        self.widgets[
-            "assignee"
-        ].onKeyPress = "selectWidget('assignee_option', event)"
+        self.widgets["assignee"].onKeyPress = (
+            "selectWidget('assignee_option', event)"
+        )
 
     def validate(self, data):
         """Validates the form."""
@@ -1323,13 +1323,13 @@ class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin):
             has_blueprints = data.get("has_blueprints", True)
             has_no_blueprints = data.get("has_no_blueprints", True)
             if has_blueprints and not has_no_blueprints:
-                data[
-                    "linked_blueprints"
-                ] = BugBlueprintSearch.BUGS_WITH_BLUEPRINTS
+                data["linked_blueprints"] = (
+                    BugBlueprintSearch.BUGS_WITH_BLUEPRINTS
+                )
             elif not has_blueprints and has_no_blueprints:
-                data[
-                    "linked_blueprints"
-                ] = BugBlueprintSearch.BUGS_WITHOUT_BLUEPRINTS
+                data["linked_blueprints"] = (
+                    BugBlueprintSearch.BUGS_WITHOUT_BLUEPRINTS
+                )
             else:
                 data["linked_blueprints"] = BugBlueprintSearch.ALL
 
diff --git a/lib/lp/bugs/browser/bugsubscription.py b/lib/lp/bugs/browser/bugsubscription.py
index 7d8a776..c722a4a 100644
--- a/lib/lp/bugs/browser/bugsubscription.py
+++ b/lib/lp/bugs/browser/bugsubscription.py
@@ -152,9 +152,9 @@ class AdvancedSubscriptionMixin:
         self.form_fields += formlib.form.Fields(
             self._bug_notification_level_field
         )
-        self.form_fields[
-            "bug_notification_level"
-        ].custom_widget = CustomWidgetFactory(RadioWidget)
+        self.form_fields["bug_notification_level"].custom_widget = (
+            CustomWidgetFactory(RadioWidget)
+        )
 
 
 class BugSubscriptionSubscribeSelfView(
@@ -341,9 +341,9 @@ class BugSubscriptionSubscribeSelfView(
         """See `LaunchpadFormView`."""
         super().setUpWidgets()
         self.widgets["subscription"].widget_class = "bug-subscription-basic"
-        self.widgets[
-            "bug_notification_level"
-        ].widget_class = "bug-notification-level-field"
+        self.widgets["bug_notification_level"].widget_class = (
+            "bug-notification-level-field"
+        )
         if len(self.form_fields["subscription"].field.vocabulary) == 1:
             # We hide the subscription widget if the user isn't
             # subscribed, since we know who the subscriber is and we
diff --git a/lib/lp/bugs/browser/bugtarget.py b/lib/lp/bugs/browser/bugtarget.py
index 6e4b6f8..cd5b919 100644
--- a/lib/lp/bugs/browser/bugtarget.py
+++ b/lib/lp/bugs/browser/bugtarget.py
@@ -266,9 +266,9 @@ class FileBugViewBase(LaunchpadFormView):
             excluded_items=[BugTaskImportance.UNKNOWN],
         )
         cache.objects["bugtask_importance_data"] = bugtask_importance_data
-        cache.objects[
-            "enable_bugfiling_duplicate_search"
-        ] = self.context.enable_bugfiling_duplicate_search
+        cache.objects["enable_bugfiling_duplicate_search"] = (
+            self.context.enable_bugfiling_duplicate_search
+        )
 
         super().initialize()
 
@@ -483,9 +483,9 @@ class FileBugViewBase(LaunchpadFormView):
         super().setUpWidgets()
 
         if "packagename" in self.field_names:
-            self.widgets[
-                "packagename"
-            ].onKeyPress = "selectWidget('choose', event)"
+            self.widgets["packagename"].onKeyPress = (
+                "selectWidget('choose', event)"
+            )
 
     def setUpFields(self):
         """Set up the form fields. See `LaunchpadFormView`."""
diff --git a/lib/lp/bugs/browser/bugtracker.py b/lib/lp/bugs/browser/bugtracker.py
index 07389e1..ee92930 100644
--- a/lib/lp/bugs/browser/bugtracker.py
+++ b/lib/lp/bugs/browser/bugtracker.py
@@ -320,9 +320,11 @@ class BugTrackerEditView(LaunchpadEditFormView):
             # let's just escape them anyway.
             aliases_errors = self.widgets["aliases"]._error.errors.args[0]
             maybe_structured_errors = [
-                structured(error)
-                if isinstance(error, LaunchpadValidationError)
-                else error
+                (
+                    structured(error)
+                    if isinstance(error, LaunchpadValidationError)
+                    else error
+                )
                 for error in aliases_errors
             ]
             self.setFieldError(
diff --git a/lib/lp/bugs/browser/structuralsubscription.py b/lib/lp/bugs/browser/structuralsubscription.py
index 95e5145..ec278f7 100644
--- a/lib/lp/bugs/browser/structuralsubscription.py
+++ b/lib/lp/bugs/browser/structuralsubscription.py
@@ -66,7 +66,6 @@ class StructuralSubscriptionNavigation(Navigation):
 
 
 class StructuralSubscriptionView(LaunchpadFormView):
-
     """View class for structural subscriptions."""
 
     schema = IStructuralSubscriptionForm
diff --git a/lib/lp/bugs/browser/tests/bugtask-adding-views.rst b/lib/lp/bugs/browser/tests/bugtask-adding-views.rst
index 6830c37..642e9ce 100644
--- a/lib/lp/bugs/browser/tests/bugtask-adding-views.rst
+++ b/lib/lp/bugs/browser/tests/bugtask-adding-views.rst
@@ -345,9 +345,9 @@ If the URL is valid but there's no bugtracker registered with that URL,
 we ask the user if they want to register the bugtracker as well.
 
     >>> form["field.product"] = "aptoncd"
-    >>> form[
-    ...     "field.bug_url"
-    ... ] = "http://bugzilla.somewhere.org/bugs/show_bug.cgi?id=84";
+    >>> form["field.bug_url"] = (
+    ...     "http://bugzilla.somewhere.org/bugs/show_bug.cgi?id=84";
+    ... )
     >>> add_task_view = get_and_setup_view(
     ...     firefox_task, "+choose-affected-product", form
     ... )
@@ -380,12 +380,12 @@ If we specify a URL of an already registered bug tracker, both the task
 and the bug watch will be added without any confirmation needed:
 
     >>> form["field.product"] = "alsa-utils"
-    >>> form[
-    ...     "field.bug_url"
-    ... ] = "http://bugzilla.gnome.org/bugs/show_bug.cgi?id=84";
-    >>> form[
-    ...     "field.__visited_steps__"
-    ... ] = "choose_product|specify_remote_bug_url"
+    >>> form["field.bug_url"] = (
+    ...     "http://bugzilla.gnome.org/bugs/show_bug.cgi?id=84";
+    ... )
+    >>> form["field.__visited_steps__"] = (
+    ...     "choose_product|specify_remote_bug_url"
+    ... )
     >>> add_task_view = get_and_setup_view(
     ...     firefox_task, "+choose-affected-product", form
     ... )
diff --git a/lib/lp/bugs/browser/tests/test_bugtask.py b/lib/lp/bugs/browser/tests/test_bugtask.py
index cfa6b9b..2a1eb92 100644
--- a/lib/lp/bugs/browser/tests/test_bugtask.py
+++ b/lib/lp/bugs/browser/tests/test_bugtask.py
@@ -280,9 +280,9 @@ class TestBugTaskView(TestCaseWithFactory):
         milestone = self.factory.makeMilestone(product=product)
         with person_logged_in(subscriber):
             structsub = milestone.addBugSubscription(subscriber, subscriber)
-            structsub.bug_filters[
-                0
-            ].bug_notification_level = BugNotificationLevel.LIFECYCLE
+            structsub.bug_filters[0].bug_notification_level = (
+                BugNotificationLevel.LIFECYCLE
+            )
         bug = self.factory.makeBug(target=product)
         with person_logged_in(product.owner):
             form_data = {
@@ -1449,9 +1449,9 @@ class TestBugTaskEditViewStatusField(TestCaseWithFactory):
     def test_status_field_bug_task_in_status_expired(self):
         # If a bugtask has the status Expired, this status is included
         # in the options.
-        removeSecurityProxy(
-            self.bug.default_bugtask
-        )._status = BugTaskStatus.EXPIRED
+        removeSecurityProxy(self.bug.default_bugtask)._status = (
+            BugTaskStatus.EXPIRED
+        )
         no_priv = getUtility(IPersonSet).getByName("no-priv")
         self.assertStatuses(
             [
@@ -1742,12 +1742,12 @@ class TestBugTaskEditView(WithScenarios, TestCaseWithFactory):
         url = canonical_url(bug_task, view_name="+editstatus")
         browser = self.getUserBrowser(url, user=bug_task.owner)
         browser.getControl(name="ubuntu.target").value = "package"
-        browser.getControl(
-            name="ubuntu.target.distribution"
-        ).value = oci_distro_name
-        browser.getControl(
-            name="ubuntu.target.package"
-        ).value = oci_project_name
+        browser.getControl(name="ubuntu.target.distribution").value = (
+            oci_distro_name
+        )
+        browser.getControl(name="ubuntu.target.package").value = (
+            oci_project_name
+        )
         browser.getControl("Save Changes").click()
 
         with admin_logged_in():
@@ -1771,9 +1771,9 @@ class TestBugTaskEditView(WithScenarios, TestCaseWithFactory):
         url = canonical_url(bug_task, view_name="+editstatus")
         browser = self.getUserBrowser(url, user=bug_task.owner)
         browser.getControl(name="oci-distro.target").value = "package"
-        browser.getControl(
-            name="oci-distro.target.distribution"
-        ).value = "ubuntu"
+        browser.getControl(name="oci-distro.target.distribution").value = (
+            "ubuntu"
+        )
         browser.getControl(name="oci-distro.target.package").value = ""
         browser.getControl("Save Changes").click()
 
@@ -1800,9 +1800,9 @@ class TestBugTaskEditView(WithScenarios, TestCaseWithFactory):
         url = canonical_url(bug_task, view_name="+editstatus")
         browser = self.getUserBrowser(url, user=bug_task.owner)
         browser.getControl(name="oci-distro.target").value = "package"
-        browser.getControl(
-            name="oci-distro.target.distribution"
-        ).value = "ubuntu"
+        browser.getControl(name="oci-distro.target.distribution").value = (
+            "ubuntu"
+        )
         browser.getControl(name="oci-distro.target.package").value = sp.name
         browser.getControl("Save Changes").click()
 
diff --git a/lib/lp/bugs/doc/externalbugtracker-comment-imports.rst b/lib/lp/bugs/doc/externalbugtracker-comment-imports.rst
index a861c4c..a0a67b0 100644
--- a/lib/lp/bugs/doc/externalbugtracker-comment-imports.rst
+++ b/lib/lp/bugs/doc/externalbugtracker-comment-imports.rst
@@ -192,9 +192,9 @@ is associated with the existing person.
     ...     "No Priv",
     ...     "no-priv@xxxxxxxxxxxxx",
     ... )
-    >>> external_bugtracker.remote_comments[
-    ...     "no-priv-comment"
-    ... ] = "The fifth comment."
+    >>> external_bugtracker.remote_comments["no-priv-comment"] = (
+    ...     "The fifth comment."
+    ... )
 
     >>> transaction.commit()
 
@@ -211,9 +211,9 @@ method will return a tuple of (displayname, None), which can then be
 used to create a Person based on the displayname alone.
 
     >>> external_bugtracker.poster_tuple = ("noemail", None)
-    >>> external_bugtracker.remote_comments[
-    ...     "no-email-comment"
-    ... ] = "Yet another comment."
+    >>> external_bugtracker.remote_comments["no-email-comment"] = (
+    ...     "Yet another comment."
+    ... )
 
     >>> transaction.commit()
 
@@ -237,9 +237,9 @@ created for them) an error will be logged and the comment will not be
 imported.
 
     >>> external_bugtracker.poster_tuple = (None, None)
-    >>> external_bugtracker.remote_comments[
-    ...     "invalid-person-comment"
-    ... ] = "This will not be imported."
+    >>> external_bugtracker.remote_comments["invalid-person-comment"] = (
+    ...     "This will not be imported."
+    ... )
 
     >>> transaction.commit()
 
@@ -464,9 +464,9 @@ includes a CVE reference appear to come from a valid Launchpad user.
     ...     foo_bar.displayname,
     ...     foo_bar.preferredemail.email,
     ... )
-    >>> external_bugtracker.remote_comments[
-    ...     "6"
-    ... ] = "Another comment, another CVE: CVE-1999-0593."
+    >>> external_bugtracker.remote_comments["6"] = (
+    ...     "Another comment, another CVE: CVE-1999-0593."
+    ... )
 
 Once again, CVE links are created but no karma is assigned.
 
diff --git a/lib/lp/bugs/doc/externalbugtracker-debbugs.rst b/lib/lp/bugs/doc/externalbugtracker-debbugs.rst
index 34861ea..8201177 100644
--- a/lib/lp/bugs/doc/externalbugtracker-debbugs.rst
+++ b/lib/lp/bugs/doc/externalbugtracker-debbugs.rst
@@ -599,18 +599,18 @@ correct date.
 If we add a Received header that isn't related to the domain of the
 current instance, the Date header will still have precedence.
 
-    >>> test_message[
-    ...     "received"
-    ... ] = "by thiswontwork.com; Tue, 15 Jul 2008 09:12:11 +0100"
+    >>> test_message["received"] = (
+    ...     "by thiswontwork.com; Tue, 15 Jul 2008 09:12:11 +0100"
+    ... )
     >>> external_debbugs._getDateForComment(test_message)
     datetime.datetime(2008, 7, 14, 20, 10, 10, tzinfo=datetime.timezone.utc)
 
 If there's a Received header that references the correct domain, the
 date in that header will take precedence.
 
-    >>> test_message[
-    ...     "received"
-    ... ] = "by example.com; Tue, 15 Jul 2008 10:20:11 +0100"
+    >>> test_message["received"] = (
+    ...     "by example.com; Tue, 15 Jul 2008 10:20:11 +0100"
+    ... )
     >>> external_debbugs._getDateForComment(test_message)
     datetime.datetime(2008, 7, 15, 9, 20, 11, tzinfo=datetime.timezone.utc)
 
diff --git a/lib/lp/bugs/doc/externalbugtracker.rst b/lib/lp/bugs/doc/externalbugtracker.rst
index b2288ef..8b380b9 100644
--- a/lib/lp/bugs/doc/externalbugtracker.rst
+++ b/lib/lp/bugs/doc/externalbugtracker.rst
@@ -90,9 +90,9 @@ remote server.
     >>> def get_trackers_and_watches(bugtracker, watches):
     ...     transaction.commit()
     ...     try:
-    ...         BUG_TRACKER_CLASSES[
-    ...             BugTrackerType.BUGZILLA
-    ...         ] = NonConnectingBugzilla
+    ...         BUG_TRACKER_CLASSES[BugTrackerType.BUGZILLA] = (
+    ...             NonConnectingBugzilla
+    ...         )
     ...         trackers_and_watches = (
     ...             bug_watch_updater._getExternalBugTrackersAndWatches(
     ...                 bugtracker, watches
diff --git a/lib/lp/bugs/mail/newbug.py b/lib/lp/bugs/mail/newbug.py
index aa44bd2..ca6cff8 100644
--- a/lib/lp/bugs/mail/newbug.py
+++ b/lib/lp/bugs/mail/newbug.py
@@ -81,26 +81,26 @@ def generate_bug_add_email(
 
                 if modified_bugtask.assignee.is_team:
                     contents += 'your team "%(team_name)s" '
-                    content_substitutions[
-                        "team_name"
-                    ] = modified_bugtask.assignee.display_name
+                    content_substitutions["team_name"] = (
+                        modified_bugtask.assignee.display_name
+                    )
                 else:
                     contents += "you "
 
             contents += "for %(target)s"
-            content_substitutions[
-                "assigner"
-            ] = event_creator.unique_displayname
-            content_substitutions[
-                "target"
-            ] = modified_bugtask.target.displayname
+            content_substitutions["assigner"] = (
+                event_creator.unique_displayname
+            )
+            content_substitutions["target"] = (
+                modified_bugtask.target.displayname
+            )
         else:
             contents += "You have been subscribed to a %(visibility)s bug"
         if subscribed_by is not None:
             contents += " by %(subscribed_by)s"
-            content_substitutions[
-                "subscribed_by"
-            ] = subscribed_by.unique_displayname
+            content_substitutions["subscribed_by"] = (
+                subscribed_by.unique_displayname
+            )
         contents += ":\n\n" "%(description)s\n\n%(bug_info)s"
         # The visibility appears mid-phrase so.. hack hack.
         content_substitutions["visibility"] = visibility.lower()
diff --git a/lib/lp/bugs/model/tests/test_bug.py b/lib/lp/bugs/model/tests/test_bug.py
index 103cf98..1697658 100644
--- a/lib/lp/bugs/model/tests/test_bug.py
+++ b/lib/lp/bugs/model/tests/test_bug.py
@@ -1019,9 +1019,9 @@ class TestBugPrivacy(TestCaseWithFactory):
         bug = self.factory.makeBug(
             target=product, information_type=InformationType.PUBLICSECURITY
         )
-        removeSecurityProxy(
-            product
-        ).bug_sharing_policy = BugSharingPolicy.FORBIDDEN
+        removeSecurityProxy(product).bug_sharing_policy = (
+            BugSharingPolicy.FORBIDDEN
+        )
         self.assertContentEqual(
             [InformationType.PUBLICSECURITY],
             bug.getAllowedInformationTypes(None),
diff --git a/lib/lp/bugs/model/tests/test_bugsummary.py b/lib/lp/bugs/model/tests/test_bugsummary.py
index de50b73..b7801bf 100644
--- a/lib/lp/bugs/model/tests/test_bugsummary.py
+++ b/lib/lp/bugs/model/tests/test_bugsummary.py
@@ -481,9 +481,9 @@ class TestBugSummary(TestCaseWithFactory):
             sourcepackagename=sourcepackage_b.sourcepackagename,
         )
 
-        removeSecurityProxy(
-            bug_task
-        ).sourcepackagename = sourcepackage_b.sourcepackagename
+        removeSecurityProxy(bug_task).sourcepackagename = (
+            sourcepackage_b.sourcepackagename
+        )
 
         self.assertCount(1, distribution=distribution, sourcepackagename=None)
         self.assertCount(
diff --git a/lib/lp/bugs/model/tests/test_bugtask.py b/lib/lp/bugs/model/tests/test_bugtask.py
index 81e242c..f607999 100644
--- a/lib/lp/bugs/model/tests/test_bugtask.py
+++ b/lib/lp/bugs/model/tests/test_bugtask.py
@@ -708,7 +708,6 @@ class TestBugTaskTags(TestCase):
 
 
 class TestBugTaskBadges(TestCaseWithFactory):
-
     """Verify getBugTaskBadgeProperties"""
 
     layer = DatabaseFunctionalLayer
diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst b/lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst
index bfe9b75..b67bcd2 100644
--- a/lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst
+++ b/lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst
@@ -12,9 +12,9 @@ The test browser does not support javascript
     >>> user_browser.open(
     ...     "http://bugs.launchpad.test/firefox/+bug/1/+affects-new-product";
     ... )
-    >>> user_browser.getControl(
-    ...     "Bug URL"
-    ... ).value = "http://bugs.foo.org/bugs/show_bug.cgi?id=42";
+    >>> user_browser.getControl("Bug URL").value = (
+    ...     "http://bugs.foo.org/bugs/show_bug.cgi?id=42";
+    ... )
     >>> user_browser.getControl("Project name").value = "The Foo Project"
     >>> user_browser.getControl("Project ID").value = "foo"
     >>> user_browser.getControl("Project summary").value = "The Foo Project"
@@ -37,9 +37,9 @@ for the user to use as the affected upstream.
     ... )
     >>> print(user_browser.title)
     Register project affected by...
-    >>> user_browser.getControl(
-    ...     "Bug URL"
-    ... ).value = "http://bugs.foo.org/bugs/show_bug.cgi?id=421";
+    >>> user_browser.getControl("Bug URL").value = (
+    ...     "http://bugs.foo.org/bugs/show_bug.cgi?id=421";
+    ... )
     >>> user_browser.getControl("Project name").value = "The Bar Project"
     >>> user_browser.getControl("Project ID").value = "bar"
     >>> user_browser.getControl("Project summary").value = "The Bar Project"
@@ -90,9 +90,9 @@ Now we'll tell Launchpad to not use the existing upstream as we want to report
 the bug as affecting another (unregistered) upstream.
 
     >>> user_browser.goBack()
-    >>> user_browser.getControl(
-    ...     "Bug URL"
-    ... ).value = "http://bugs.foo.org/bugs/show_bug.cgi?id=123";
+    >>> user_browser.getControl("Bug URL").value = (
+    ...     "http://bugs.foo.org/bugs/show_bug.cgi?id=123";
+    ... )
     >>> user_browser.getControl("Continue").click()
     >>> user_browser.title
     'Bug #2 (blackhole) ... : Bugs : The Bar Project'
@@ -109,9 +109,9 @@ user and ask them to check if it's correct.
     >>> user_browser.open(
     ...     "http://bugs.launchpad.test/firefox/+bug/1/+affects-new-product";
     ... )
-    >>> user_browser.getControl(
-    ...     "Bug URL"
-    ... ).value = "http://foo.org/notabug.cgi?id=42";
+    >>> user_browser.getControl("Bug URL").value = (
+    ...     "http://foo.org/notabug.cgi?id=42";
+    ... )
     >>> user_browser.getControl("Project name").value = "Foo Project"
     >>> user_browser.getControl("Project ID").value = "bazfoo"
     >>> user_browser.getControl("Project summary").value = "The Foo Project"
diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst b/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst
index c9b9188..606b8a1 100644
--- a/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst
+++ b/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst
@@ -56,9 +56,9 @@ Let's assign the existing Ubuntu task to mozilla-firefox, then add
 another task on Ubuntu evolution.
 
     >>> browser.open("http://localhost/ubuntu/+bug/6/+editstatus";)
-    >>> browser.getControl(
-    ...     name="ubuntu.target.package"
-    ... ).value = "mozilla-firefox"
+    >>> browser.getControl(name="ubuntu.target.package").value = (
+    ...     "mozilla-firefox"
+    ... )
     >>> browser.getControl("Save Changes").click()
 
     >>> browser.open(
@@ -94,9 +94,9 @@ Launchpad, we add a bug watch as well.
 
     >>> browser.getControl(name="field.distribution").value = ["debian"]
     >>> browser.getControl("Source Package Name").value = "alsa-utils"
-    >>> browser.getControl(
-    ...     "URL"
-    ... ).value = "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=123";
+    >>> browser.getControl("URL").value = (
+    ...     "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=123";
+    ... )
     >>> browser.getControl("Continue").click()
     >>> print(browser.url)
     http://bugs.launchpad.test/debian/+source/alsa-utils/+bug/1
@@ -107,9 +107,9 @@ error, because Ubuntu uses Launchpad as its bug tracker
     >>> browser.getLink(url="+distrotask").click()
     >>> browser.getControl("Distribution").value = ["ubuntu"]
     >>> browser.getControl("Source Package Name").value = "alsa-utils"
-    >>> browser.getControl(
-    ...     "URL"
-    ... ).value = "https://bugzilla.mozilla.org/show_bug.cgi?id=84";
+    >>> browser.getControl("URL").value = (
+    ...     "https://bugzilla.mozilla.org/show_bug.cgi?id=84";
+    ... )
     >>> browser.getControl("Continue").click()
     >>> print(browser.url)
     http://bugs.launchpad.test/debian/+source/alsa-utils/+bug/1/+distrotask
@@ -393,9 +393,9 @@ need to make sure that everything is quoted before displaying the input.
     ...     "/+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
@@ -420,9 +420,9 @@ white space in the bug URL it will be stripped.
     >>> user_browser.getControl("Continue").click()
 
     >>> user_browser.getControl("I have the URL").selected = True
-    >>> user_browser.getControl(
-    ...     name="field.bug_url"
-    ... ).value = "   https://bugzilla.mozilla.org/show_bug.cgi?id=1234   "
+    >>> user_browser.getControl(name="field.bug_url").value = (
+    ...     "   https://bugzilla.mozilla.org/show_bug.cgi?id=1234   "
+    ... )
     >>> user_browser.getControl("Add to Bug Report").click()
 
 Launchpad redirects to the newly created bugtask page, with a row for
@@ -479,9 +479,9 @@ bugtask, our validator springs into action.
     >>> print(user_browser.url)
     http://bugs.launchpad.test/evolution/+bug/3/+editstatus
 
-    >>> user_browser.getControl(
-    ...     name="evolution.target.product"
-    ... ).value = "alsa-utils"
+    >>> user_browser.getControl(name="evolution.target.product").value = (
+    ...     "alsa-utils"
+    ... )
     >>> user_browser.getControl("Save Changes").click()
     >>> print(user_browser.url)
     http://bugs.launchpad.test/evolution/+bug/3/+editstatus
@@ -511,9 +511,9 @@ the URL of the remote bug.
     http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product
 
     >>> user_browser.getControl("I have the URL").selected = True
-    >>> user_browser.getControl(
-    ...     name="field.bug_url"
-    ... ).value = "http://bugzilla.gnome.org/bugs/show_bug.cgi?id=42";
+    >>> user_browser.getControl(name="field.bug_url").value = (
+    ...     "http://bugzilla.gnome.org/bugs/show_bug.cgi?id=42";
+    ... )
 
 At this point, just in case we change our mind, there is a cancel link
 that points back to the bug page:
@@ -549,9 +549,9 @@ URL is HTTP.
     http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product
 
     >>> user_browser.getControl("I have the URL").selected = True
-    >>> user_browser.getControl(
-    ...     name="field.bug_url"
-    ... ).value = "https://bugzilla.gnome.org/bugs/show_bug.cgi?id=84";
+    >>> user_browser.getControl(name="field.bug_url").value = (
+    ...     "https://bugzilla.gnome.org/bugs/show_bug.cgi?id=84";
+    ... )
     >>> user_browser.getControl("Add to Bug Report").click()
     >>> print(user_browser.url)
     http://bugs.launchpad.test/netapplet/+bug/4
@@ -580,9 +580,9 @@ tracker type it is), an error message is displayed.
     http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product
 
     >>> user_browser.getControl("I have the URL").selected = True
-    >>> user_browser.getControl(
-    ...     name="field.bug_url"
-    ... ).value = "http://bugs.unknown/42";
+    >>> user_browser.getControl(name="field.bug_url").value = (
+    ...     "http://bugs.unknown/42";
+    ... )
     >>> user_browser.getControl("Add to Bug Report").click()
     >>> print(user_browser.url)
     http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product
@@ -597,9 +597,9 @@ If the URL can be recognised as a valid bug URL, but no such tracker is
 registered in Launchpad, the user will be prompted to register it first.
 
     >>> user_browser.getControl("I have the URL").selected = True
-    >>> user_browser.getControl(
-    ...     name="field.bug_url"
-    ... ).value = "http://new.trac/ticket/42";
+    >>> user_browser.getControl(name="field.bug_url").value = (
+    ...     "http://new.trac/ticket/42";
+    ... )
     >>> user_browser.getControl("Add to Bug Report").click()
     >>> print(user_browser.url)
     http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product
@@ -651,9 +651,9 @@ it to HTTP on their behalf:
     http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product
 
     >>> user_browser.getControl("I have the URL").selected = True
-    >>> user_browser.getControl(
-    ...     name="field.bug_url"
-    ... ).value = "bugzilla.gnome.org/bugs/show_bug.cgi?id=168"
+    >>> user_browser.getControl(name="field.bug_url").value = (
+    ...     "bugzilla.gnome.org/bugs/show_bug.cgi?id=168"
+    ... )
     >>> user_browser.getControl("Add to Bug Report").click()
     >>> print(user_browser.url)
     http://bugs.launchpad.test/thunderbird/+bug/4
diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst b/lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst
index c391d80..0b36279 100644
--- a/lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst
+++ b/lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst
@@ -82,9 +82,9 @@ duplicates.
     >>> user_browser.open("http://launchpad.test/bugs/5";)
     >>> user_browser.getLink(url="+distrotask").click()
     >>> user_browser.getControl("Distribution").value = ["debian"]
-    >>> user_browser.getControl(
-    ...     "Source Package Name"
-    ... ).value = "mozilla-firefox"
+    >>> user_browser.getControl("Source Package Name").value = (
+    ...     "mozilla-firefox"
+    ... )
     >>> user_browser.getControl("URL").value = debian_bug
     >>> user_browser.getControl("Continue").click()
     >>> print_feedback_messages(user_browser.contents)
diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst b/lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst
index 3a017c1..777ca05 100644
--- a/lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst
+++ b/lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst
@@ -45,9 +45,9 @@ link to a external bug for it.
     >>> user_browser.getLink("Also affects distribution/package").click()
     >>> user_browser.getControl("Distribution").value = ["gentoo"]
     >>> user_browser.getControl("Source Package").value = ""
-    >>> user_browser.getControl(
-    ...     "URL"
-    ... ).value = "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1234";
+    >>> user_browser.getControl("URL").value = (
+    ...     "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1234";
+    ... )
     >>> user_browser.getControl("Continue").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/gentoo/+bug/7'
diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst b/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst
index 18ccad3..1536372 100644
--- a/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst
+++ b/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst
@@ -33,9 +33,9 @@ to reflect this.
     ...     "http://launchpad.test/thunderbird/+configure-bugtracker";
     ... )
     >>> admin_browser.getControl(name="field.bugtracker").value = ["external"]
-    >>> admin_browser.getControl(
-    ...     name="field.bugtracker.bugtracker"
-    ... ).value = "mozilla.org"
+    >>> admin_browser.getControl(name="field.bugtracker.bugtracker").value = (
+    ...     "mozilla.org"
+    ... )
     >>> admin_browser.getControl("Change").click()
 
     >>> user_browser.open("http://launchpad.test/bugs/13/";)
@@ -97,12 +97,12 @@ filing link, such as Debbugs, only a search link will be displayed.
     >>> admin_browser.open(
     ...     "http://launchpad.test/gnome-terminal/+configure-bugtracker";
     ... )
-    >>> admin_browser.getControl(
-    ...     "In a registered bug tracker:"
-    ... ).selected = True
-    >>> admin_browser.getControl(
-    ...     name="field.bugtracker.bugtracker"
-    ... ).value = "debbugs"
+    >>> admin_browser.getControl("In a registered bug tracker:").selected = (
+    ...     True
+    ... )
+    >>> admin_browser.getControl(name="field.bugtracker.bugtracker").value = (
+    ...     "debbugs"
+    ... )
     >>> admin_browser.getControl("Change").click()
 
     >>> user_browser.open("http://launchpad.test/bugs/13/";)
@@ -129,9 +129,9 @@ tracker, can be set from the +configure-bugtracker page, too.
     >>> admin_browser.open(
     ...     "http://launchpad.test/thunderbird/+configure-bugtracker";
     ... )
-    >>> admin_browser.getControl(
-    ...     name="field.remote_product"
-    ... ).value = "Thunderbird"
+    >>> admin_browser.getControl(name="field.remote_product").value = (
+    ...     "Thunderbird"
+    ... )
     >>> admin_browser.getControl("Change").click()
 
     >>> admin_browser.open(
diff --git a/lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst b/lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst
index 4f3a13c..6dcbd8d 100644
--- a/lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst
+++ b/lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst
@@ -31,9 +31,9 @@ bug page.
 
 The Ubuntu maintainer, Ubuntu Team, will be subscribed.
 
-    >>> browser.getControl(
-    ...     name="field.title", index=0
-    ... ).value = "a private bug"
+    >>> browser.getControl(name="field.title", index=0).value = (
+    ...     "a private bug"
+    ... )
     >>> browser.getControl("Continue").click()
 
     >>> browser.getControl(name="packagename_option").value = ["choose"]
diff --git a/lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst b/lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst
index 9efcdce..bc1affa 100644
--- a/lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst
+++ b/lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst
@@ -31,9 +31,9 @@ bugs or where the product requests that bugs are private by default)
 have the full message:
 
     >>> browser.open("http://bugs.launchpad.test/firefox/+filebug";)
-    >>> browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Firefox crashes when I change the default route"
+    >>> browser.getControl("Summary", index=0).value = (
+    ...     "Firefox crashes when I change the default route"
+    ... )
     >>> browser.getControl("Continue").click()
 
     >>> browser.getControl("Further information").value = "foo"
diff --git a/lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst b/lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst
index 6aeefa8..0e4541a 100644
--- a/lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst
+++ b/lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst
@@ -44,9 +44,9 @@ The tags field and its related messages are properly escaped in order
 to prevent XSS.
 
     >>> anon_browser.open("http://launchpad.test/ubuntu/+bugs?advanced=1";)
-    >>> anon_browser.getControl(
-    ...     "Tags"
-    ... ).value = '<script>alert("cheezburger");</script>'
+    >>> anon_browser.getControl("Tags").value = (
+    ...     '<script>alert("cheezburger");</script>'
+    ... )
     >>> anon_browser.getControl("Search", index=0).click()
 
 The value can be obtained correctly, which indicates that the markup
diff --git a/lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst b/lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst
index 8816e6a..a6f30ab 100644
--- a/lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst
+++ b/lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst
@@ -25,12 +25,12 @@ attachment.
     >>> user_browser.getControl("Attachment").add_file(
     ...     foo_file, "text/plain", "foo.txt"
     ... )
-    >>> user_browser.getControl(
-    ...     "Description"
-    ... ).value = "   Some information   "
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Added some information"
+    >>> user_browser.getControl("Description").value = (
+    ...     "   Some information   "
+    ... )
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "Added some information"
+    ... )
     >>> user_browser.getControl("Post Comment").click()
 
 After we added the attachment, we get redirected to the bug page.
@@ -101,9 +101,9 @@ attachment.
     ...     "This attachment contains a solution (patch) for this bug"
     ... )
     >>> patch_control.selected = True
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Added some information"
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "Added some information"
+    ... )
     >>> user_browser.getControl("Post Comment").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/firefox/+bug/1'
@@ -123,9 +123,9 @@ the flag "this attachment is a patch"...
     ...     "This attachment contains a solution (patch) for this bug"
     ... )
     >>> patch_control.selected = False
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Added even more information"
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "Added even more information"
+    ... )
     >>> user_browser.getControl("Post Comment").click()
 
 ...we are redirected to a page...
@@ -256,9 +256,9 @@ when we tell it that plain text files whose names end in ".diff",
     ...     "This attachment contains a solution (patch) for this bug"
     ... )
     >>> patch_control.selected = True
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Add foo3.diff as a patch."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "Add foo3.diff as a patch."
+    ... )
     >>> user_browser.getControl("Post Comment").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/firefox/+bug/1'
@@ -275,9 +275,9 @@ when we tell it that plain text files whose names end in ".diff",
     ...     "This attachment contains a solution (patch) for this bug"
     ... )
     >>> patch_control.selected = True
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Add foo4.debdiff as a patch."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "Add foo4.debdiff as a patch."
+    ... )
     >>> user_browser.getControl("Post Comment").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/firefox/+bug/1'
@@ -294,9 +294,9 @@ when we tell it that plain text files whose names end in ".diff",
     ...     "This attachment contains a solution (patch) for this bug"
     ... )
     >>> patch_control.selected = True
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Add foo5.patch as a patch."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "Add foo5.patch as a patch."
+    ... )
     >>> user_browser.getControl("Post Comment").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/firefox/+bug/1'
@@ -422,9 +422,9 @@ Let's add a normal text file...
     ...     BytesIO(b"Traceback..."), "text/plain", "foo.txt"
     ... )
     >>> user_browser.getControl("Description").value = "Some information."
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Added some information."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "Added some information."
+    ... )
     >>> user_browser.getControl("Post Comment").click()
 
 And a patch...
@@ -439,9 +439,9 @@ And a patch...
     ... )
     >>> user_browser.getControl("patch").selected = True
     >>> user_browser.getControl("Description").value = "A patch."
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "This patch fixes the bug."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "This patch fixes the bug."
+    ... )
     >>> user_browser.getControl("Post Comment").click()
 
 And another patch...
@@ -455,9 +455,9 @@ And another patch...
     ... )
     >>> user_browser.getControl("patch").selected = True
     >>> user_browser.getControl("Description").value = "A patch."
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "This patch fixes the bug."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "This patch fixes the bug."
+    ... )
     >>> user_browser.getControl("Post Comment").click()
 
 And now we'll search for patches for firefox bugs.
diff --git a/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst b/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst
index 9c0118b..a2db4e3 100644
--- a/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst
+++ b/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst
@@ -14,9 +14,9 @@ File size and mime type are displayed for each attachment
     ...     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'
@@ -50,9 +50,9 @@ A filesize of 2700 byte is displayed in 'KiB'
     ...     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-add-comment-bugtask-edit.rst b/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.rst
index b971fa8..70d1976 100644
--- a/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.rst
+++ b/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.rst
@@ -11,9 +11,9 @@ the comment to another comment field.
     >>> user_browser.open(
     ...     "http://bugs.launchpad.test/firefox/+bug/1/+editstatus";
     ... )
-    >>> user_browser.getControl(
-    ...     "Comment"
-    ... ).value = "A comment with no change to the bug task."
+    >>> user_browser.getControl("Comment").value = (
+    ...     "A comment with no change to the bug task."
+    ... )
     >>> user_browser.getControl("Save Changes").click()
 
 The user was returned to the bug page, and the comment was added.
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-activity.rst b/lib/lp/bugs/stories/bugs/xx-bug-activity.rst
index bb385e0..e50de32 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-activity.rst
+++ b/lib/lp/bugs/stories/bugs/xx-bug-activity.rst
@@ -67,9 +67,9 @@ page.
     >>> user_browser.open(
     ...     "http://bugs.launchpad.test/redfish/+bug/15/+addcomment";
     ... )
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Here's a comment for testing, like."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "Here's a comment for testing, like."
+    ... )
     >>> user_browser.getControl("Post Comment").click()
     >>> print_comments(user_browser.contents, slice(None))
     Revision history for this message
@@ -112,9 +112,9 @@ Changes to the bug's description will simply be displayed as 'description:
 updated', since such changes can be quite long.
 
     >>> admin_browser.open("http://bugs.launchpad.test/redfish/+bug/15/+edit";)
-    >>> admin_browser.getControl(
-    ...     "Description"
-    ... ).value = "I've changed the description, isn't that excellent?"
+    >>> admin_browser.getControl("Description").value = (
+    ...     "I've changed the description, isn't that excellent?"
+    ... )
     >>> admin_browser.getControl("Change").click()
 
     >>> admin_browser.open("http://launchpad.test/bugs/15";)
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst b/lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst
index 669bc1f..7de405b 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst
+++ b/lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst
@@ -45,9 +45,9 @@ A comment and attachment can be submitted in one request.
     >>> user_browser.open(
     ...     "http://bugs.launchpad.test/firefox/+bug/1/+addcomment-form";
     ... )
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "this is a comment"
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "this is a comment"
+    ... )
     >>> user_browser.getControl("Attachment").add_file(
     ...     BytesIO(b"some file"), "text/plain", "bar.txt"
     ... )
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst b/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst
index 3ccfe3c..952f62b 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst
+++ b/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst
@@ -6,9 +6,9 @@ will not show up when browsing the comment list for a bug.
 All comments are set visible by default.
 
     >>> user_browser.open("http://bugs.launchpad.test"; "/jokosher/+bug/11")
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "This comment will not be visible when the test completes."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "This comment will not be visible when the test completes."
+    ... )
     >>> user_browser.getControl("Post Comment", index=-1).click()
     >>> main_content = find_main_content(user_browser.contents)
     >>> new_comment = main_content("div", "boardCommentBody")[-1]
diff --git a/lib/lp/bugs/stories/bugs/xx-bugs.rst b/lib/lp/bugs/stories/bugs/xx-bugs.rst
index 7cbb23d..c5ae800 100644
--- a/lib/lp/bugs/stories/bugs/xx-bugs.rst
+++ b/lib/lp/bugs/stories/bugs/xx-bugs.rst
@@ -27,9 +27,9 @@ Bar. First, let's clear out the notification table:
     >>> user_browser.open(
     ...     "http://localhost/debian/+source/mozilla-firefox/+bug/2";
     ... )
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "This is a test comment."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "This is a test comment."
+    ... )
     >>> user_browser.getControl("Post Comment", index=-1).click()
 
     >>> user_browser.url
diff --git a/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst b/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst
index 700e99e..9382c9b 100644
--- a/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst
+++ b/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst
@@ -63,9 +63,9 @@ No Privileges Person can supply new information by posting a new
 comment for the bug.
 
     >>> user_browser.open("http://bugs.launchpad.test/jokosher/+bug/11";)
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "More information here."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "More information here."
+    ... )
     >>> user_browser.getControl("Post Comment").click()
 
     >>> import transaction
diff --git a/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst b/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst
index a1ad3c1..b2b6d91 100644
--- a/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst
+++ b/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst
@@ -47,9 +47,9 @@ individual comment page, where the inline form is displayed.
 
 We enter a comment, and submit the form.
 
-    >>> user_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "A reply comment."
+    >>> user_browser.getControl(name="field.comment").value = (
+    ...     "A reply comment."
+    ... )
     >>> user_browser.getControl(name="field.actions.save").click()
 
 The new comment appears, formatted as a remote bug comment.
@@ -92,9 +92,9 @@ the 'awaiting synchronization' mark goes away.
     >>> bug_message = getUtility(IBugMessageSet).getByBugAndMessage(
     ...     bug_15, message
     ... )
-    >>> removeSecurityProxy(
-    ...     bug_message
-    ... ).remote_comment_id = "test-remote-comment-id"
+    >>> removeSecurityProxy(bug_message).remote_comment_id = (
+    ...     "test-remote-comment-id"
+    ... )
     >>> flush_database_updates()
     >>> logout()
 
diff --git a/lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst b/lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst
index 1610ef0..fa5725c 100644
--- a/lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst
+++ b/lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst
@@ -64,9 +64,9 @@ Bug Supervisor
 Ubuntu needs a Bug Supervisor first of all:
 
     >>> admin_browser.open("http://bugs.launchpad.test/ubuntu/+bugsupervisor";)
-    >>> admin_browser.getControl(
-    ...     "Bug Supervisor"
-    ... ).value = "test@xxxxxxxxxxxxx"
+    >>> admin_browser.getControl("Bug Supervisor").value = (
+    ...     "test@xxxxxxxxxxxxx"
+    ... )
     >>> admin_browser.getControl("Change").click()
 
     >>> print(
diff --git a/lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst b/lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst
index 387fcce..88c75da 100644
--- a/lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst
+++ b/lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst
@@ -52,9 +52,9 @@ elsewhere:
     >>> user_browser.getControl("Project").value = "gnome-terminal"
     >>> user_browser.getControl("Continue").click()
     >>> user_browser.getControl("I have the URL").selected = True
-    >>> user_browser.getControl(
-    ...     name="field.bug_url"
-    ... ).value = "http://mantis.bugtracker/view.php?id=1234";
+    >>> user_browser.getControl(name="field.bug_url").value = (
+    ...     "http://mantis.bugtracker/view.php?id=1234";
+    ... )
     >>> user_browser.getControl("Add to Bug Report").click()
     >>> user_browser.getControl(
     ...     "Register Bug Tracker and Add to Bug Report"
diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst b/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst
index 0185219..2122ce7 100644
--- a/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst
+++ b/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst
@@ -58,9 +58,9 @@ 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.getControl(
-    ...     name="field.assignee"
-    ... ).value = "invalid-assignee"
+    >>> anon_browser.getControl(name="field.assignee").value = (
+    ...     "invalid-assignee"
+    ... )
     >>> anon_browser.getControl("Search", index=0).click()
     >>> print_feedback_messages(anon_browser.contents)
     There's no person with the name or email address 'invalid-assignee'.
@@ -68,9 +68,9 @@ If we enter an invalid assignee, we'll get a nice error message.
     >>> anon_browser.open(
     ...     "http://bugs.launchpad.test/~name12/+reportedbugs?advanced=1";
     ... )
-    >>> anon_browser.getControl(
-    ...     name="field.assignee"
-    ... ).value = "invalid-assignee"
+    >>> anon_browser.getControl(name="field.assignee").value = (
+    ...     "invalid-assignee"
+    ... )
     >>> anon_browser.getControl("Search", index=0).click()
     >>> print_feedback_messages(anon_browser.contents)
     There's no person with the name or email address 'invalid-assignee'.
@@ -102,17 +102,17 @@ and invalid searches don't OOPS:
     >>> anon_browser.open(
     ...     "http://bugs.launchpad.test/debian/+bugs?advanced=1";
     ... )
-    >>> anon_browser.getControl(
-    ...     name="field.bug_reporter"
-    ... ).value = "invalid-reporter"
+    >>> anon_browser.getControl(name="field.bug_reporter").value = (
+    ...     "invalid-reporter"
+    ... )
     >>> anon_browser.getControl("Search", index=0).click()
     >>> print_feedback_messages(anon_browser.contents)
     There's no person with the name or email address 'invalid-reporter'.
 
     >>> anon_browser.open("http://bugs.launchpad.test/~name12/+assignedbugs";)
-    >>> anon_browser.getControl(
-    ...     name="field.bug_reporter"
-    ... ).value = "invalid-reporter"
+    >>> anon_browser.getControl(name="field.bug_reporter").value = (
+    ...     "invalid-reporter"
+    ... )
     >>> anon_browser.getControl("Search", index=0).click()
     >>> print_feedback_messages(anon_browser.contents)
     There's no person with the name or email address 'invalid-reporter'.
@@ -173,9 +173,9 @@ context, only bugs for Ubuntu packages will be returned. In Ubuntu, Foo
 Bar is a package subscriber for mozilla-firefox and pmount, but there
 aren't any bugs open for pmount.
 
-    >>> anon_browser.getControl(
-    ...     "Package or series subscriber"
-    ... ).value = "foo.bar@xxxxxxxxxxxxx"
+    >>> anon_browser.getControl("Package or series subscriber").value = (
+    ...     "foo.bar@xxxxxxxxxxxxx"
+    ... )
     >>> anon_browser.getControl("Search", index=0).click()
 
     >>> from lp.bugs.tests.bug import print_bugtasks
diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst b/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst
index 00b0704..3e17ab5 100644
--- a/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst
+++ b/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst
@@ -40,9 +40,9 @@ We go to the global bug search page and search for bugs with all the tags.
 Only 'test bug a' is returned.
 
     >>> anon_browser.open("http://bugs.launchpad.test/bugs/+bugs?advanced=1";)
-    >>> anon_browser.getControl(
-    ...     name="field.tag"
-    ... ).value = "test-tag-1 test-tag-2"
+    >>> anon_browser.getControl(name="field.tag").value = (
+    ...     "test-tag-1 test-tag-2"
+    ... )
     >>> anon_browser.getControl(name="field.tags_combinator").value = ["ALL"]
     >>> anon_browser.getControl("Search", index=1).click()
     >>> "test bug a" in anon_browser.contents
@@ -54,9 +54,9 @@ We go to the bug search page and search for bugs with any of the tags.
 Both bugs are returned.
 
     >>> anon_browser.open("http://launchpad.test/firefox/+bugs?advanced=1";)
-    >>> anon_browser.getControl(
-    ...     name="field.tag"
-    ... ).value = "test-tag-1 test-tag-2"
+    >>> anon_browser.getControl(name="field.tag").value = (
+    ...     "test-tag-1 test-tag-2"
+    ... )
     >>> anon_browser.getControl(name="field.tags_combinator").value = ["ANY"]
     >>> anon_browser.getControl("Search", index=1).click()
     >>> "test bug a" in anon_browser.contents
@@ -67,9 +67,9 @@ Both bugs are returned.
 Same works for user related bugs:
 
     >>> anon_browser.open("http://launchpad.test/~name16/+bugs?advanced=1";)
-    >>> anon_browser.getControl(
-    ...     name="field.tag"
-    ... ).value = "test-tag-1 test-tag-2"
+    >>> anon_browser.getControl(name="field.tag").value = (
+    ...     "test-tag-1 test-tag-2"
+    ... )
     >>> anon_browser.getControl(name="field.tags_combinator").value = ["ANY"]
     >>> anon_browser.getControl("Search", index=1).click()
     >>> "test bug a" in anon_browser.contents
@@ -81,9 +81,9 @@ When we search for bugs with all the tags, though, only the first bug is
 returned, since it's the only bug with both tags.
 
     >>> anon_browser.open("http://launchpad.test/firefox/+bugs?advanced=1";)
-    >>> anon_browser.getControl(
-    ...     name="field.tag"
-    ... ).value = "test-tag-1 test-tag-2"
+    >>> anon_browser.getControl(name="field.tag").value = (
+    ...     "test-tag-1 test-tag-2"
+    ... )
     >>> anon_browser.getControl(name="field.tags_combinator").value = ["ALL"]
     >>> anon_browser.getControl("Search", index=1).click()
     >>> "test bug a" in anon_browser.contents
@@ -94,9 +94,9 @@ returned, since it's the only bug with both tags.
 And also for user related bugs:
 
     >>> anon_browser.open("http://launchpad.test/~name16/+bugs?advanced=1";)
-    >>> anon_browser.getControl(
-    ...     name="field.tag"
-    ... ).value = "test-tag-1 test-tag-2"
+    >>> anon_browser.getControl(name="field.tag").value = (
+    ...     "test-tag-1 test-tag-2"
+    ... )
     >>> anon_browser.getControl(name="field.tags_combinator").value = ["ALL"]
     >>> anon_browser.getControl("Search", index=1).click()
     >>> "test bug a" in anon_browser.contents
diff --git a/lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst b/lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst
index 47d847d..ec483fa 100644
--- a/lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst
+++ b/lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst
@@ -62,9 +62,9 @@ auto-created ones - so the title is also obfuscated.
     >>> admin_browser.open(
     ...     "http://launchpad.test/bugs/bugtrackers/email/+edit";
     ... )
-    >>> admin_browser.getControl(
-    ...     "Title"
-    ... ).value = "an@email.address bug tracker"
+    >>> admin_browser.getControl("Title").value = (
+    ...     "an@email.address bug tracker"
+    ... )
     >>> admin_browser.getControl("Change").click()
 
     >>> anon_browser.open("http://launchpad.test/bugs/bugtrackers";)
diff --git a/lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst b/lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst
index 0beb941..4018672 100644
--- a/lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst
+++ b/lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst
@@ -52,9 +52,9 @@ aren't allowed.
     ...     "Mantis"
     ... ).click()
     >>> user_browser.getControl("Title").value = "Test Mantis Tracker"
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "This is a test MANTIS tracker."
+    >>> user_browser.getControl("Summary").value = (
+    ...     "This is a test MANTIS tracker."
+    ... )
     >>> url = "http://mantis.testing.org/";
     >>> user_browser.getControl("Location").value = url
     >>> user_browser.getControl("Contact details").value = "blah blah"
@@ -73,9 +73,9 @@ If a bug tracker is already registered with the same location, the user
 is informed about it.
 
     >>> user_browser.getControl("Name").value = "testmantis"
-    >>> user_browser.getControl(
-    ...     "Location"
-    ... ).value = "http://bugzilla.mozilla.org/";
+    >>> user_browser.getControl("Location").value = (
+    ...     "http://bugzilla.mozilla.org/";
+    ... )
     >>> user_browser.getControl("Add").click()
 
     >>> user_browser.url
@@ -105,9 +105,9 @@ we'll dig directly to the database.
     >>> gnome_bugzilla.aliases = ["http://alias.example.com/";]
     >>> logout()
 
-    >>> user_browser.getControl(
-    ...     "Location"
-    ... ).value = "http://alias.example.com/";
+    >>> user_browser.getControl("Location").value = (
+    ...     "http://alias.example.com/";
+    ... )
     >>> user_browser.getControl("Add").click()
 
     >>> user_browser.url
@@ -165,9 +165,9 @@ bugtracker without them is acceptable.
     >>> user_browser.getControl("Name").value = "test-bugzilla"
     >>> user_browser.getControl("Title").value = "Test Bugzilla"
     >>> user_browser.getControl("Bug Tracker Type").value = ["Bugzilla"]
-    >>> user_browser.getControl(
-    ...     "Location"
-    ... ).value = "http://bugzilla.example.org/";
+    >>> user_browser.getControl("Location").value = (
+    ...     "http://bugzilla.example.org/";
+    ... )
     >>> user_browser.getControl("Add").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/bugs/bugtrackers/test-bugzilla'
@@ -192,9 +192,9 @@ we'll get a nice error message.
     ...     "Mantis"
     ... ).click()
     >>> user_browser.getControl("Title").value = "Test Mantis Tracker"
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "This is a test TRAC tracker."
+    >>> user_browser.getControl("Summary").value = (
+    ...     "This is a test TRAC tracker."
+    ... )
     >>> url = "http://trac.example.org/tickets";
     >>> user_browser.getControl("Location").value = url
     >>> user_browser.getControl("Contact details").value = "blah blah"
@@ -222,9 +222,9 @@ We can edit the details of the newly added bugtracker.
     >>> user_browser.getControl("Bug Tracker Type").getControl(
     ...     "Bugzilla"
     ... ).click()
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "This is used to be a test TRAC bug tracker."
+    >>> user_browser.getControl("Summary").value = (
+    ...     "This is used to be a test TRAC bug tracker."
+    ... )
 
 There is a cancel link if we change our mind:
 
@@ -234,9 +234,9 @@ There is a cancel link if we change our mind:
 It's not possible to change the base URL to something that another bug
 tracker uses.
 
-    >>> user_browser.getControl(
-    ...     "Location", index=0
-    ... ).value = "http://bugzilla.mozilla.org/";
+    >>> user_browser.getControl("Location", index=0).value = (
+    ...     "http://bugzilla.mozilla.org/";
+    ... )
     >>> user_browser.getControl("Change").click()
 
     >>> user_browser.url
@@ -250,18 +250,18 @@ tracker uses.
 If the user inadvertently enters an invalid URL, they are shown an
 informative error message explaining why it is invalid.
 
-    >>> user_browser.getControl(
-    ...     "Location", index=0
-    ... ).value = "what? my wife does this stuff"
+    >>> user_browser.getControl("Location", index=0).value = (
+    ...     "what? my wife does this stuff"
+    ... )
     >>> user_browser.getControl("Change").click()
 
     >>> print_feedback_messages(user_browser.contents)
     There is 1 error.
     "what? my wife does this stuff" is not a valid URI
 
-    >>> user_browser.getControl(
-    ...     "Location", index=0
-    ... ).value = "http://ξνεr.been.fishing?";
+    >>> user_browser.getControl("Location", index=0).value = (
+    ...     "http://ξνεr.been.fishing?";
+    ... )
     >>> user_browser.getControl("Change").click()
 
     >>> print_feedback_messages(user_browser.contents)
@@ -308,9 +308,9 @@ to change.
     http://mantis.testing.org/ (Alias)
 
     >>> user_browser.getLink("Change details").click()
-    >>> user_browser.getControl(
-    ...     "Location", index=0
-    ... ).value = "https://trac.example.org/tickets";
+    >>> user_browser.getControl("Location", index=0).value = (
+    ...     "https://trac.example.org/tickets";
+    ... )
     >>> user_browser.getControl("Change").click()
 
     >>> print(
@@ -337,9 +337,9 @@ They're added on the normal Change Details page.
     ... )
     >>> user_browser.getLink("Change details").click()
 
-    >>> user_browser.getControl(
-    ...     "Location aliases"
-    ... ).value = "http://pseudonym.example.com/";
+    >>> user_browser.getControl("Location aliases").value = (
+    ...     "http://pseudonym.example.com/";
+    ... )
     >>> user_browser.getControl("Change").click()
 
     >>> bugtracker_url_list = find_tag_by_id(
@@ -355,9 +355,9 @@ bugtracker.
     >>> user_browser.open(
     ...     "http://launchpad.test/bugs/bugtrackers/testbugzilla/+edit";
     ... )
-    >>> user_browser.getControl(
-    ...     "Location aliases"
-    ... ).value = "http://bugzilla.mozilla.org/";
+    >>> user_browser.getControl("Location aliases").value = (
+    ...     "http://bugzilla.mozilla.org/";
+    ... )
     >>> user_browser.getControl("Change").click()
 
     >>> print_feedback_messages(user_browser.contents)
@@ -391,9 +391,9 @@ shown informative error messages.
     >>> user_browser.open(
     ...     "http://launchpad.test/bugs/bugtrackers/testbugzilla/+edit";
     ... )
-    >>> user_browser.getControl(
-    ...     "Location aliases"
-    ... ).value = "ξνεr been http://fishing?";
+    >>> user_browser.getControl("Location aliases").value = (
+    ...     "ξνεr been http://fishing?";
+    ... )
     >>> user_browser.getControl("Change").click()
 
     >>> print_feedback_messages(user_browser.contents)
@@ -413,9 +413,9 @@ example bug tracker:
     ... )
     >>> user_browser.getControl("Name").value = "freddy"
     >>> user_browser.getControl("Title").value = "Freddy's Bugs"
-    >>> user_browser.getControl(
-    ...     "Location"
-    ... ).value = "http://freddy.example.com/";
+    >>> user_browser.getControl("Location").value = (
+    ...     "http://freddy.example.com/";
+    ... )
     >>> user_browser.getControl("Add").click()
 
 Being brand-new and pristine, there will be nothing to prevent its
diff --git a/lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst b/lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst
index 4ef9680..93853ce 100644
--- a/lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst
+++ b/lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst
@@ -5,9 +5,9 @@ Edi a bug watch
 After a bug watch is recorded, it is possible to go back and change it.
 
     >>> admin_browser.open("http://bugs.launchpad.test/bugs/1/+watch/2";)
-    >>> admin_browser.getControl(
-    ...     "URL"
-    ... ).value = "https://bugzilla.mozilla.org/show_bug.cgi?id=1000";
+    >>> admin_browser.getControl("URL").value = (
+    ...     "https://bugzilla.mozilla.org/show_bug.cgi?id=1000";
+    ... )
     >>> admin_browser.getControl("Change").click()
     >>> admin_browser.url
     'http://bugs.launchpad.test/firefox/+bug/1'
@@ -20,9 +20,9 @@ The URL supplied must be a valid bug tracker URL and must point to a
 bug tracker already registered with Launchpad.
 
     >>> admin_browser.open("http://bugs.launchpad.test/bugs/1/+watch/2";)
-    >>> admin_browser.getControl(
-    ...     "URL"
-    ... ).value = "https://bugzilla.mozilla.org/foo_bug.cgi?id=1000";
+    >>> admin_browser.getControl("URL").value = (
+    ...     "https://bugzilla.mozilla.org/foo_bug.cgi?id=1000";
+    ... )
     >>> admin_browser.getControl("Change").click()
     >>> admin_browser.url
     'http://bugs.launchpad.test/bugs/1/+watch/2/+edit'
diff --git a/lib/lp/bugs/stories/cve/xx-cve-link-xss.rst b/lib/lp/bugs/stories/cve/xx-cve-link-xss.rst
index f45f667..1a0beca 100644
--- a/lib/lp/bugs/stories/cve/xx-cve-link-xss.rst
+++ b/lib/lp/bugs/stories/cve/xx-cve-link-xss.rst
@@ -5,9 +5,9 @@ The CVE Sequence Number field and its related messages are properly
 escaped in order to prevent XSS.
 
     >>> user_browser.open("http://launchpad.test/firefox/+bug/6/+linkcve";)
-    >>> user_browser.getControl(
-    ...     "CVE Sequence Number"
-    ... ).value = '<script>alert("cheezburger");</script>'
+    >>> user_browser.getControl("CVE Sequence Number").value = (
+    ...     '<script>alert("cheezburger");</script>'
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 The value can be obtained correctly, which indicates that the markup
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst
index 8b7c0a8..f22fc18 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst
@@ -92,13 +92,13 @@ description.
     ...         context_path,
     ...     )
     ...     user_browser.open(filebug_url)
-    ...     user_browser.getControl(
-    ...         "Summary", index=0
-    ...     ).value = "It doesn't work"
+    ...     user_browser.getControl("Summary", index=0).value = (
+    ...         "It doesn't work"
+    ...     )
     ...     user_browser.getControl("Continue").click()
-    ...     user_browser.getControl(
-    ...         "Further information"
-    ...     ).value = "please help!"
+    ...     user_browser.getControl("Further information").value = (
+    ...         "please help!"
+    ...     )
     ...     print_guidelines(context_name, user_browser)
     ...     user_browser.getControl("Submit Bug Report").click()
     ...     print_acknowledgement_message(user_browser)
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst
index 5f36cf6..68642d6 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst
@@ -134,9 +134,9 @@ Even if the form has errors the token will be present in the URL.
 If we go ahead submitting the bug, the bug will have all the extra
 information specified in the extra filebug data.
 
-    >>> user_browser.getControl(
-    ...     "Further information"
-    ... ).value = "A bug description."
+    >>> user_browser.getControl("Further information").value = (
+    ...     "A bug description."
+    ... )
     >>> user_browser.getControl("Submit Bug Report").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+bug/...'
@@ -233,9 +233,9 @@ The user can of course change the tags if they want.
 
     >>> user_browser.getControl("Tags").value = "bar baz"
     >>> user_browser.getControl("Summary", index=0).value = "Bug Summary"
-    >>> user_browser.getControl(
-    ...     "Further information"
-    ... ).value = "Bug description."
+    >>> user_browser.getControl("Further information").value = (
+    ...     "Bug description."
+    ... )
     >>> user_browser.getControl("Submit Bug Report").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+bug/...'
@@ -254,9 +254,9 @@ that will get their tags set as well.
     >>> user_browser.getControl("Summary", index=0).value = "Bug Summary"
     >>> user_browser.getControl("Continue").click()
 
-    >>> user_browser.getControl(
-    ...     "Further information"
-    ... ).value = "Bug description."
+    >>> user_browser.getControl("Further information").value = (
+    ...     "Bug description."
+    ... )
     >>> user_browser.getControl("Submit Bug Report").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+bug/...'
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst
index 7178234..7dd3c82 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst
@@ -12,9 +12,9 @@ that deal with new package request with a certain tag.
     ...     "http://bugs.launchpad.test/ubuntu/+filebug";
     ...     "?field.tags=new-package"
     ... )
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Please package CoolApp"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "Please package CoolApp"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 On the next page, possible duplicates are displayed as usual. No
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst
index ff30885..8df2c97 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst
@@ -12,9 +12,9 @@ The example here are a little short - in reality we have a comprehensive
 database to find candidates from, our sample data has no real near-fits,
 see bug 612384 for the overall effort to provide a sensible search facility.
 
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Thunderbird crashes opening"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "Thunderbird crashes opening"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 ...yields one similar bug.
@@ -43,9 +43,9 @@ back...
     # We should use goBack() here but can't because of bug #98372:
     # zope.testbrowser truncates document content after goBack().
     >>> user_browser.open("http://launchpad.test/ubuntu/+filebug";)
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Thunderbird crashes when opening large emails"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "Thunderbird crashes when opening large emails"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 ...and continue filing our bug.
@@ -89,9 +89,9 @@ different in the user agent.
 
 Submitting a distinctive bug title...
 
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Frobnobulator emits weird noises."
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "Frobnobulator emits weird noises."
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 ...yields no similar bugs. In fact, the similar bugs table is not even
@@ -107,9 +107,9 @@ But the bug can be filed as before.
 
     >>> user_browser.getControl(name="packagename_option").value = ["choose"]
     >>> user_browser.getControl("In what package").value = "mozilla-firefox"
-    >>> user_browser.getControl(
-    ...     "Further information"
-    ... ).value = "Frobnobulator is a Firefox add-on, ..."
+    >>> user_browser.getControl("Further information").value = (
+    ...     "Frobnobulator is a Firefox add-on, ..."
+    ... )
     >>> user_browser.getControl("Submit Bug Report").click()
 
     >>> print(user_browser.url)
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst b/lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst
index 20ba75d..5bd7a33 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst
@@ -6,9 +6,9 @@ Thunderbird bug.
     >>> user_browser.open(
     ...     "http://launchpad.test/ubuntu/+source/mozilla-firefox/"; "+filebug"
     ... )
-    >>> user_browser.getControl(
-    ...     name="field.title", index=0
-    ... ).value = "Thunderbird crashes when opening large emails"
+    >>> user_browser.getControl(name="field.title", index=0).value = (
+    ...     "Thunderbird crashes when opening large emails"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 In this case, since we search only Ubuntu Firefox bugs, there are no
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst b/lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst
index 01ff274..32baa95 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst
@@ -17,9 +17,9 @@ guided filebug form.
     ...     "A totally new " "bug with attachments"
     ... )
     >>> user_browser.getControl("Continue").click()
-    >>> user_browser.getControl(
-    ...     "Further information"
-    ... ).value = "We can now add attachments!"
+    >>> user_browser.getControl("Further information").value = (
+    ...     "We can now add attachments!"
+    ... )
 
 No Privileges Person chooses to add an attachment to the bug. We create
 a file-like object to demonstrate this.
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst b/lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst
index ae577cc..f708dd6 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst
@@ -14,9 +14,9 @@ is being filed.
     >>> user_browser.getControl("Summary", index=0).value = "Bug with tags"
     >>> user_browser.getControl("Continue").click()
     >>> user_browser.getControl("Tags").value = "foo bar"
-    >>> user_browser.getControl(
-    ...     "Further information"
-    ... ).value = "This bug has tags"
+    >>> user_browser.getControl("Further information").value = (
+    ...     "This bug has tags"
+    ... )
     >>> user_browser.getControl("Submit Bug Report").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/firefox/+bug/...'
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst b/lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst
index d1f3847..dda726f 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst
@@ -30,9 +30,9 @@ If no title is entered, the user is asked to supply one.
 The user fills in some keywords, and clicks a button to search existing
 bugs.
 
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "SVG images are broken"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "SVG images are broken"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 The form is self-posting, so the user is still at +filebug. This makes
@@ -91,9 +91,9 @@ subscribe to it instead of filing a new bug. This also loosely implies a
 "me too" vote.
 
     >>> user_browser.open("http://bugs.launchpad.test/firefox/+filebug";)
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "SVG images are broken"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "SVG images are broken"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 As before, we get a list of similar bugs to choose from.
@@ -120,9 +120,9 @@ handled by a JavaScript FormOverlay, but for the sake of integration
 testing we'll test it here, too.
 
     >>> user_browser.open("http://bugs.launchpad.test/firefox/+filebug";)
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "SVG images are broken"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "SVG images are broken"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 There's a hidden field on the "yes, this is my bug" form, which we can
@@ -150,9 +150,9 @@ different in the user agent.
 
 Submitting some distinctive details...
 
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Frankenzombulon reanimated neighbour's dead pet"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "Frankenzombulon reanimated neighbour's dead pet"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 ...yields no similar bugs. In fact, the similar bugs table is not even
@@ -167,9 +167,9 @@ shown.
 But, as before, entering a description and submitting the bug takes the
 user to the bug page.
 
-    >>> user_browser.getControl(
-    ...     "Further information"
-    ... ).value = "Frankenzombulon is only meant to check my mail."
+    >>> user_browser.getControl("Further information").value = (
+    ...     "Frankenzombulon is only meant to check my mail."
+    ... )
     >>> user_browser.getControl("Submit Bug Report").click()
     >>> user_browser.url
     'http://bugs.launchpad.test/firefox/+bug/...'
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst b/lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst
index 2ef1540..34478f3 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst
@@ -20,9 +20,9 @@ After we selected a product and entered a summary, we're sent to the
 product's +filebug page to search for duplicates.
 
     >>> user_browser.getControl("Project", index=0).value = ["evolution"]
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Evolution crashes"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "Evolution crashes"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
     >>> user_browser.url
diff --git a/lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst b/lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst
index f997418..ef5584f 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst
+++ b/lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst
@@ -14,9 +14,9 @@ that point.
 
     >>> user_browser.open("http://launchpad.test/products/firefox/+filebug";)
 
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Firefox does not support complex SVG images"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "Firefox does not support complex SVG images"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
     >>> from lp.bugs.tests.bug import print_bugs_list
@@ -30,9 +30,9 @@ be reversed.
 
     >>> user_browser.open("http://launchpad.test/products/firefox/+filebug";)
 
-    >>> user_browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "Reflow problems with SVG"
+    >>> user_browser.getControl("Summary", index=0).value = (
+    ...     "Reflow problems with SVG"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
     >>> print_bugs_list(user_browser.contents, "similar-bugs")
diff --git a/lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst b/lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst
index 3185b95..1a215d7 100644
--- a/lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst
+++ b/lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst
@@ -20,9 +20,9 @@ will use the advanced filebug form to skip searching for dupes.
 If you enter a package name that doesn't exist in the distribution,
 you're returned to the page, with the "choose" radio button selected.
 
-    >>> user_browser.getControl(
-    ...     name="field.packagename"
-    ... ).value = "nosuchpackage"
+    >>> user_browser.getControl(name="field.packagename").value = (
+    ...     "nosuchpackage"
+    ... )
     >>> user_browser.getControl("Submit Bug Report").click()
 
     >>> user_browser.url
diff --git a/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst b/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst
index 6ea7a5f..9f4c059 100644
--- a/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst
+++ b/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst
@@ -3,17 +3,17 @@ contact, the maintainer will be subscribed to the bug instead.
 
     >>> browser = setupBrowser(auth="Basic foo.bar@xxxxxxxxxxxxx:test")
     >>> browser.open("http://localhost:9000/firefox/+filebug";)
-    >>> browser.getControl(
-    ...     "Summary", index=0
-    ... ).value = "this is a newly created private bug"
+    >>> browser.getControl("Summary", index=0).value = (
+    ...     "this is a newly created private bug"
+    ... )
     >>> browser.getControl("Continue").click()
 
-    >>> browser.getControl(
-    ...     name="field.title"
-    ... ).value = "this is a newly created private bug"
-    >>> browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "very secret info here"
+    >>> browser.getControl(name="field.title").value = (
+    ...     "this is a newly created private bug"
+    ... )
+    >>> browser.getControl(name="field.comment").value = (
+    ...     "very secret info here"
+    ... )
     >>> browser.getControl("Private Security").selected = True
     >>> browser.getControl("Submit Bug Report").click()
 
diff --git a/lib/lp/bugs/tests/test_bug.py b/lib/lp/bugs/tests/test_bug.py
index 57680fb..d4265f9 100644
--- a/lib/lp/bugs/tests/test_bug.py
+++ b/lib/lp/bugs/tests/test_bug.py
@@ -438,9 +438,9 @@ class TestBugPermissions(TestCaseWithFactory, KarmaTestMixin):
 
     def test_target_bug_supervisor_can_edit(self):
         person = self.factory.makePerson()
-        removeSecurityProxy(
-            self.bug.default_bugtask.target
-        ).bug_supervisor = person
+        removeSecurityProxy(self.bug.default_bugtask.target).bug_supervisor = (
+            person
+        )
         with person_logged_in(person):
             self.assertTrue(checkPermission("launchpad.Edit", self.bug))
 
@@ -656,9 +656,9 @@ class TestBugLocking(TestCaseWithFactory):
             self.assertTrue(checkPermission("launchpad.Moderate", bug))
 
         yet_another_person = self.factory.makePerson()
-        removeSecurityProxy(
-            bug.default_bugtask.target
-        ).bug_supervisor = yet_another_person
+        removeSecurityProxy(bug.default_bugtask.target).bug_supervisor = (
+            yet_another_person
+        )
         with person_logged_in(yet_another_person):
             self.assertTrue(checkPermission("launchpad.Moderate", bug))
 
diff --git a/lib/lp/bugs/tests/test_bug_messages.py b/lib/lp/bugs/tests/test_bug_messages.py
index 5b926c2..c2a744a 100644
--- a/lib/lp/bugs/tests/test_bug_messages.py
+++ b/lib/lp/bugs/tests/test_bug_messages.py
@@ -45,7 +45,6 @@ class TestBugIndexedMessages(TestCaseWithFactory):
 
 
 class TestUserCanSetCommentVisibility(TestCaseWithFactory):
-
     """Test whether expected users can toggle bug comment visibility."""
 
     layer = DatabaseFunctionalLayer
@@ -84,7 +83,6 @@ class TestUserCanSetCommentVisibility(TestCaseWithFactory):
 
 
 class TestBugLinkMessageSetsIncompleteStatus(TestCaseWithFactory):
-
     """Test that Bug.linkMessage updates "Incomplete (without response)" bugs.
 
     They should transition from "Incomplete (without response)" to
diff --git a/lib/lp/bugs/tests/test_bugtaskflat_triggers.py b/lib/lp/bugs/tests/test_bugtaskflat_triggers.py
index 7f91c86..7ecbfca 100644
--- a/lib/lp/bugs/tests/test_bugtaskflat_triggers.py
+++ b/lib/lp/bugs/tests/test_bugtaskflat_triggers.py
@@ -331,9 +331,9 @@ class TestBugTaskFlatTriggers(BugTaskFlatTestMixin):
         # Triggers maintain BugTaskFlat when a bug is changed
         task = self.makeLoggedInTask()
         with self.bugtaskflat_is_updated(task, ["information_type"]):
-            removeSecurityProxy(
-                task.bug
-            ).information_type = InformationType.PUBLICSECURITY
+            removeSecurityProxy(task.bug).information_type = (
+                InformationType.PUBLICSECURITY
+            )
 
     def test_bug_make_private(self):
         # Triggers maintain BugTaskFlat when a bug is made private.
@@ -341,9 +341,9 @@ class TestBugTaskFlatTriggers(BugTaskFlatTestMixin):
         with self.bugtaskflat_is_updated(
             task, ["information_type", "access_policies", "access_grants"]
         ):
-            removeSecurityProxy(
-                task.bug
-            ).information_type = InformationType.USERDATA
+            removeSecurityProxy(task.bug).information_type = (
+                InformationType.USERDATA
+            )
 
     def test_bug_make_public(self):
         # Triggers maintain BugTaskFlat when a bug is made public.
diff --git a/lib/lp/buildmaster/builderproxy.py b/lib/lp/buildmaster/builderproxy.py
index cdc5c36..be65e29 100644
--- a/lib/lp/buildmaster/builderproxy.py
+++ b/lib/lp/buildmaster/builderproxy.py
@@ -40,13 +40,13 @@ class BuilderProxyMixin:
     ) -> Generator[None, Dict[str, str], None]:
         if _get_proxy_config("builder_proxy_host") and allow_internet:
             token = yield self._requestProxyToken()
-            args[
-                "proxy_url"
-            ] = "http://{username}:{password}@{host}:{port}".format(
-                username=token["username"],
-                password=token["secret"],
-                host=_get_proxy_config("builder_proxy_host"),
-                port=_get_proxy_config("builder_proxy_port"),
+            args["proxy_url"] = (
+                "http://{username}:{password}@{host}:{port}".format(
+                    username=token["username"],
+                    password=token["secret"],
+                    host=_get_proxy_config("builder_proxy_host"),
+                    port=_get_proxy_config("builder_proxy_port"),
+                )
             )
             args["revocation_endpoint"] = "{endpoint}/{token}".format(
                 endpoint=_get_proxy_config("builder_proxy_auth_api_endpoint"),
diff --git a/lib/lp/buildmaster/model/buildfarmjob.py b/lib/lp/buildmaster/model/buildfarmjob.py
index a152c14..e3a910a 100644
--- a/lib/lp/buildmaster/model/buildfarmjob.py
+++ b/lib/lp/buildmaster/model/buildfarmjob.py
@@ -264,9 +264,9 @@ class BuildFarmJobMixin:
             # XXX cprov 20060615 bug=120584: Currently buildduration includes
             # the scanner latency, it should really be asking the worker for
             # the duration spent building locally.
-            self.build_farm_job.date_finished = (
-                self.date_finished
-            ) = date_finished or datetime.now(timezone.utc)
+            self.build_farm_job.date_finished = self.date_finished = (
+                date_finished or datetime.now(timezone.utc)
+            )
             self.emitMetric("finished", status=status.name)
 
     def gotFailure(self):
diff --git a/lib/lp/charms/browser/tests/test_charmrecipe.py b/lib/lp/charms/browser/tests/test_charmrecipe.py
index 427b96f..d3a27b7 100644
--- a/lib/lp/charms/browser/tests/test_charmrecipe.py
+++ b/lib/lp/charms/browser/tests/test_charmrecipe.py
@@ -235,9 +235,9 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView):
             project, view_name="+new-charm-recipe", user=self.person
         )
         browser.getControl(name="field.name").value = "charm-name"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_shortened_path
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_shortened_path
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
         browser.getControl("Create charm recipe").click()
 
@@ -321,15 +321,15 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView):
         browser.getControl(
             name="field.auto_build_channels.charmcraft"
         ).value = "edge"
-        browser.getControl(
-            name="field.auto_build_channels.core"
-        ).value = "stable"
-        browser.getControl(
-            name="field.auto_build_channels.core18"
-        ).value = "beta"
-        browser.getControl(
-            name="field.auto_build_channels.core20"
-        ).value = "edge/feature"
+        browser.getControl(name="field.auto_build_channels.core").value = (
+            "stable"
+        )
+        browser.getControl(name="field.auto_build_channels.core18").value = (
+            "beta"
+        )
+        browser.getControl(name="field.auto_build_channels.core20").value = (
+            "edge/feature"
+        )
         browser.getControl("Create charm recipe").click()
 
         content = find_main_content(browser.contents)
@@ -366,9 +366,9 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView):
         browser.getControl("Automatically upload to store").selected = True
         browser.getControl("Registered store name").value = "charmhub-name"
         self.assertFalse(browser.getControl("Stable").selected)
-        browser.getControl(
-            name="field.store_channels.add_track"
-        ).value = "track"
+        browser.getControl(name="field.store_channels.add_track").value = (
+            "track"
+        )
         browser.getControl(name="field.store_channels.add_risk").value = [
             "edge"
         ]
@@ -525,13 +525,13 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView):
         browser.getControl("Automatically upload to store").selected = True
         browser.getControl("Registered store name").value = "charmhub-name"
         self.assertFalse(browser.getControl("Stable").selected)
-        browser.getControl(
-            name="field.store_channels.add_track"
-        ).value = "track"
+        browser.getControl(name="field.store_channels.add_track").value = (
+            "track"
+        )
         browser.getControl("Edge").selected = True
-        browser.getControl(
-            name="field.store_channels.add_branch"
-        ).value = "branch"
+        browser.getControl(name="field.store_channels.add_branch").value = (
+            "branch"
+        )
 
         browser.getControl("Create charm recipe").click()
 
@@ -560,9 +560,9 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView):
         browser.getControl("Automatically upload to store").selected = True
         browser.getControl(name="field.name").value = "test-recipe-name"
         browser.getControl("Registered store name").value = "charmhub-name"
-        browser.getControl(
-            name="field.store_channels.add_track"
-        ).value = "new-track"
+        browser.getControl(name="field.store_channels.add_track").value = (
+            "new-track"
+        )
 
         browser.getControl("Create charm recipe").click()
 
@@ -574,12 +574,12 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView):
         browser.getControl("Automatically upload to store").selected = True
         browser.getControl(name="field.name").value = "test-recipe-name"
         browser.getControl("Registered store name").value = "charmhub-name"
-        browser.getControl(
-            name="field.store_channels.add_track"
-        ).value = "new-track"
-        browser.getControl(
-            name="field.store_channels.add_branch"
-        ).value = "new-branch"
+        browser.getControl(name="field.store_channels.add_track").value = (
+            "new-track"
+        )
+        browser.getControl(name="field.store_channels.add_branch").value = (
+            "new-branch"
+        )
 
         browser.getControl("Create charm recipe").click()
 
@@ -662,9 +662,9 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView):
         browser.getLink("Edit charm recipe").click()
         browser.getControl("Owner").value = ["new-team"]
         browser.getControl(name="field.name").value = "new-name"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = new_git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            new_git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = new_git_ref_path
         browser.getControl("Build path").value = "some-path"
         browser.getControl(
@@ -723,12 +723,12 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView):
         )
         view_url = canonical_url(recipe, view_name="+edit")
         browser = self.getNonRedirectingBrowser(url=view_url, user=self.person)
-        browser.getControl(
-            name="field.store_channels.add_track"
-        ).value = "new-track"
-        browser.getControl(
-            name="field.store_channels.add_branch"
-        ).value = "new-branch"
+        browser.getControl(name="field.store_channels.add_track").value = (
+            "new-track"
+        )
+        browser.getControl(name="field.store_channels.add_branch").value = (
+            "new-branch"
+        )
         browser.getControl(name="field.store_channels.add_risk").value = [
             "edge"
         ]
@@ -799,12 +799,12 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView):
         )
         view_url = canonical_url(recipe, view_name="+edit")
         browser = self.getNonRedirectingBrowser(url=view_url, user=self.person)
-        browser.getControl(
-            name="field.store_channels.track_0"
-        ).value = "new-track"
-        browser.getControl(
-            name="field.store_channels.branch_0"
-        ).value = "new-branch"
+        browser.getControl(name="field.store_channels.track_0").value = (
+            "new-track"
+        )
+        browser.getControl(name="field.store_channels.branch_0").value = (
+            "new-branch"
+        )
         browser.getControl(name="field.store_channels.risk_0").value = [
             "candidate"
         ]
@@ -901,9 +901,9 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView):
 
         # If the user entered only Track for the new channel entry,
         # ensure we error with missing Risk message.
-        browser.getControl(
-            name="field.store_channels.add_track"
-        ).value = "new-track"
+        browser.getControl(name="field.store_channels.add_track").value = (
+            "new-track"
+        )
 
         browser.getControl("Update charm recipe").click()
 
@@ -913,9 +913,9 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView):
         # ensure we error with missing Risk message.
         browser = self.getViewBrowser(recipe, user=self.person)
         browser.getLink("Edit charm recipe").click()
-        browser.getControl(
-            name="field.store_channels.add_branch"
-        ).value = "new-branch"
+        browser.getControl(name="field.store_channels.add_branch").value = (
+            "new-branch"
+        )
 
         browser.getControl("Update charm recipe").click()
 
@@ -925,12 +925,12 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView):
         # ensure we error with missing Risk message.
         browser = self.getViewBrowser(recipe, user=self.person)
         browser.getLink("Edit charm recipe").click()
-        browser.getControl(
-            name="field.store_channels.add_track"
-        ).value = "new-track"
-        browser.getControl(
-            name="field.store_channels.add_branch"
-        ).value = "new-branch"
+        browser.getControl(name="field.store_channels.add_track").value = (
+            "new-track"
+        )
+        browser.getControl(name="field.store_channels.add_branch").value = (
+            "new-branch"
+        )
 
         browser.getControl("Update charm recipe").click()
 
@@ -1012,9 +1012,9 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView):
         private_ref_path = private_ref.path
         browser = self.getViewBrowser(recipe, user=self.person)
         browser.getLink("Edit charm recipe").click()
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = private_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            private_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = private_ref_path
         browser.getControl("Update charm recipe").click()
         self.assertEqual(
diff --git a/lib/lp/charms/browser/tests/test_charmrecipelisting.py b/lib/lp/charms/browser/tests/test_charmrecipelisting.py
index a9baeea..e37f3b8 100644
--- a/lib/lp/charms/browser/tests/test_charmrecipelisting.py
+++ b/lib/lp/charms/browser/tests/test_charmrecipelisting.py
@@ -215,9 +215,9 @@ class TestCharmRecipeListing(BrowserTestCase):
         with MemoryFeatureFixture({CHARM_RECIPE_ALLOW_CREATE: "on"}):
             recipes = [create_recipe() for i in range(count)]
         for i, recipe in enumerate(recipes):
-            removeSecurityProxy(
-                recipe
-            ).date_last_modified = start_time - timedelta(seconds=i)
+            removeSecurityProxy(recipe).date_last_modified = (
+                start_time - timedelta(seconds=i)
+            )
         return [
             soupmatchers.Tag(
                 "charm recipe link",
diff --git a/lib/lp/charms/tests/test_charmrecipe.py b/lib/lp/charms/tests/test_charmrecipe.py
index df6ba5a..0b41a97 100644
--- a/lib/lp/charms/tests/test_charmrecipe.py
+++ b/lib/lp/charms/tests/test_charmrecipe.py
@@ -736,10 +736,8 @@ class TestCharmRecipe(TestCaseWithFactory):
                 }
             )
         )
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob.failure = GitRepositoryBlobNotFound(
-            "placeholder", "charmcraft.yaml"
+        self.useFixture(GitHostingFixture()).getBlob.failure = (
+            GitRepositoryBlobNotFound("placeholder", "charmcraft.yaml")
         )
         old_distro_series = self.factory.makeDistroSeries(
             distribution=getUtility(ILaunchpadCelebrities).ubuntu,
diff --git a/lib/lp/charms/tests/test_charmrecipejob.py b/lib/lp/charms/tests/test_charmrecipejob.py
index 2b33d2e..38be8d9 100644
--- a/lib/lp/charms/tests/test_charmrecipejob.py
+++ b/lib/lp/charms/tests/test_charmrecipejob.py
@@ -239,9 +239,9 @@ class TestCharmRecipeRequestBuildsJob(TestCaseWithFactory):
         job = CharmRecipeRequestBuildsJob.create(
             recipe, recipe.registrant, channels={"core": "stable"}
         )
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob.failure = CannotParseCharmcraftYaml("Nonsense on stilts")
+        self.useFixture(GitHostingFixture()).getBlob.failure = (
+            CannotParseCharmcraftYaml("Nonsense on stilts")
+        )
         with dbuser(config.ICharmRecipeRequestBuildsJobSource.dbuser):
             JobRunner([job]).runAll()
         now = get_transaction_timestamp(IStore(recipe))
diff --git a/lib/lp/code/browser/branchmergeproposal.py b/lib/lp/code/browser/branchmergeproposal.py
index ecf1251..4d4d0cd 100644
--- a/lib/lp/code/browser/branchmergeproposal.py
+++ b/lib/lp/code/browser/branchmergeproposal.py
@@ -637,11 +637,12 @@ class BranchMergeProposalView(
             "code.bzr.diff.disable_proxy"
         ):
             # This fallback works for public branches, but not private ones.
-            cache.objects[
-                "branch_diff_link"
-            ] = "https://%s/+loggerhead/%s/diff/"; % (
-                config.launchpad.code_domain,
-                self.context.source_branch.unique_name,
+            cache.objects["branch_diff_link"] = (
+                "https://%s/+loggerhead/%s/diff/";
+                % (
+                    config.launchpad.code_domain,
+                    self.context.source_branch.unique_name,
+                )
             )
         else:
             cache.objects["branch_diff_link"] = (
diff --git a/lib/lp/code/browser/branchsubscription.py b/lib/lp/code/browser/branchsubscription.py
index 46b53a5..5877a14 100644
--- a/lib/lp/code/browser/branchsubscription.py
+++ b/lib/lp/code/browser/branchsubscription.py
@@ -64,7 +64,6 @@ class BranchPortletSubscribersContent(LaunchpadView):
 
 
 class _BranchSubscriptionView(LaunchpadFormView):
-
     """Contains the common functionality of the Add and Edit views."""
 
     schema = IBranchSubscription
diff --git a/lib/lp/code/browser/tests/test_branch.py b/lib/lp/code/browser/tests/test_branch.py
index 4987a31..0dd2c8b 100644
--- a/lib/lp/code/browser/tests/test_branch.py
+++ b/lib/lp/code/browser/tests/test_branch.py
@@ -1092,9 +1092,9 @@ class TestBranchProposalsVisible(TestCaseWithFactory):
         # If the target is private, the landing targets should not include it.
         bmp = self.factory.makeBranchMergeProposal()
         branch = bmp.source_branch
-        removeSecurityProxy(
-            bmp.target_branch
-        ).information_type = InformationType.USERDATA
+        removeSecurityProxy(bmp.target_branch).information_type = (
+            InformationType.USERDATA
+        )
         view = create_view(branch, "+index")
         self.assertTrue(view.no_merges)
         self.assertEqual([], view.landing_targets)
@@ -1115,9 +1115,9 @@ class TestBranchProposalsVisible(TestCaseWithFactory):
         # it.
         bmp = self.factory.makeBranchMergeProposal()
         branch = bmp.target_branch
-        removeSecurityProxy(
-            bmp.source_branch
-        ).information_type = InformationType.USERDATA
+        removeSecurityProxy(bmp.source_branch).information_type = (
+            InformationType.USERDATA
+        )
         view = create_view(branch, "+index")
         self.assertTrue(view.no_merges)
         self.assertEqual([], view.landing_candidates)
@@ -1137,9 +1137,9 @@ class TestBranchProposalsVisible(TestCaseWithFactory):
         # the target is private, then the dependent_branches are not shown.
         branch = self.factory.makeProductBranch()
         bmp = self.factory.makeBranchMergeProposal(prerequisite_branch=branch)
-        removeSecurityProxy(
-            bmp.source_branch
-        ).information_type = InformationType.USERDATA
+        removeSecurityProxy(bmp.source_branch).information_type = (
+            InformationType.USERDATA
+        )
         view = create_view(branch, "+index")
         self.assertTrue(view.no_merges)
         self.assertEqual([], view.dependent_branches)
diff --git a/lib/lp/code/browser/tests/test_branchmergeproposal.py b/lib/lp/code/browser/tests/test_branchmergeproposal.py
index fb29e40..f0269b0 100644
--- a/lib/lp/code/browser/tests/test_branchmergeproposal.py
+++ b/lib/lp/code/browser/tests/test_branchmergeproposal.py
@@ -951,9 +951,9 @@ class TestRegisterBranchMergeProposalViewGit(
     def test_default_branch(self):
         with admin_logged_in():
             target_branch = self._makeTargetBranch(target_default=True)
-        removeSecurityProxy(
-            target_branch.repository
-        )._default_branch = target_branch.path
+        removeSecurityProxy(target_branch.repository)._default_branch = (
+            target_branch.path
+        )
         view = self._createView()
         self.assertEqual(
             target_branch.repository.default_branch.split("/")[-1],
diff --git a/lib/lp/code/browser/tests/test_branchmergeproposallisting.py b/lib/lp/code/browser/tests/test_branchmergeproposallisting.py
index 113f3ba..f95cc3b 100644
--- a/lib/lp/code/browser/tests/test_branchmergeproposallisting.py
+++ b/lib/lp/code/browser/tests/test_branchmergeproposallisting.py
@@ -548,9 +548,9 @@ class ProductContextMixin:
 
     def setUp(self):
         super().setUp()
-        self.git_target = (
-            self.bzr_target
-        ) = self.context = self.factory.makeProduct()
+        self.git_target = self.bzr_target = self.context = (
+            self.factory.makeProduct()
+        )
         self.user = self.git_target.owner
         self.owner = None
 
@@ -575,9 +575,9 @@ class DistributionSourcePackageContextMixin:
 
     def setUp(self):
         super().setUp()
-        self.git_target = (
-            self.context
-        ) = self.factory.makeDistributionSourcePackage()
+        self.git_target = self.context = (
+            self.factory.makeDistributionSourcePackage()
+        )
         with admin_logged_in():
             getUtility(IService, "sharing").sharePillarInformation(
                 self.context.distribution,
diff --git a/lib/lp/code/browser/tests/test_sourcepackagerecipe.py b/lib/lp/code/browser/tests/test_sourcepackagerecipe.py
index 5cfc74f..dc11382 100644
--- a/lib/lp/code/browser/tests/test_sourcepackagerecipe.py
+++ b/lib/lp/code/browser/tests/test_sourcepackagerecipe.py
@@ -1964,11 +1964,11 @@ class TestSourcePackageRecipeBuildViewMixin:
         distro_series = self.factory.makeDistroSeries(
             name="squirrel", distribution=archive.distribution
         )
-        removeSecurityProxy(
-            distro_series
-        ).nominatedarchindep = self.factory.makeDistroArchSeries(
-            distroseries=distro_series,
-            processor=getUtility(IProcessorSet).getByName("386"),
+        removeSecurityProxy(distro_series).nominatedarchindep = (
+            self.factory.makeDistroArchSeries(
+                distroseries=distro_series,
+                processor=getUtility(IProcessorSet).getByName("386"),
+            )
         )
         build = self.factory.makeSourcePackageRecipeBuild(
             requester=self.user,
diff --git a/lib/lp/code/doc/codeimport-event.rst b/lib/lp/code/doc/codeimport-event.rst
index 2bddc7a..c557780 100644
--- a/lib/lp/code/doc/codeimport-event.rst
+++ b/lib/lp/code/doc/codeimport-event.rst
@@ -197,9 +197,9 @@ state of the code import.
 Then changes can be applied.
 
     >>> from lp.code.enums import CodeImportReviewStatus
-    >>> removeSecurityProxy(
-    ...     svn_import
-    ... ).review_status = CodeImportReviewStatus.SUSPENDED
+    >>> removeSecurityProxy(svn_import).review_status = (
+    ...     CodeImportReviewStatus.SUSPENDED
+    ... )
 
 After applying changes, the newModify method can create an event that
 details the changes that have been applied.
diff --git a/lib/lp/code/errors.py b/lib/lp/code/errors.py
index 82042a5..fe758c6 100644
--- a/lib/lp/code/errors.py
+++ b/lib/lp/code/errors.py
@@ -214,14 +214,12 @@ class AlreadyLatestFormat(CannotUpgradeBranch):
 
 
 class CannotUpgradeNonHosted(CannotUpgradeBranch):
-
     """Raised on attempt to upgrade a non-Hosted branch."""
 
     _msg_template = "Cannot upgrade non-hosted branch %s"
 
 
 class UpgradePending(CannotUpgradeBranch):
-
     """Raised on attempt to upgrade a branch already in the latest format."""
 
     _msg_template = "An upgrade is already in progress for branch %s."
diff --git a/lib/lp/code/mail/branch.py b/lib/lp/code/mail/branch.py
index c880ae5..99945c2 100644
--- a/lib/lp/code/mail/branch.py
+++ b/lib/lp/code/mail/branch.py
@@ -195,9 +195,9 @@ class RecipientReason(basemailer.RecipientReason):
         if self.merge_proposal is not None:
             source = self._getBranchIdentity(self.merge_proposal.merge_source)
             target = self._getBranchIdentity(self.merge_proposal.merge_target)
-            template_values[
-                "merge_proposal"
-            ] = "the proposed merge of %s into %s" % (source, target)
+            template_values["merge_proposal"] = (
+                "the proposed merge of %s into %s" % (source, target)
+            )
         return template_values
 
 
@@ -278,10 +278,10 @@ class BranchMailer(BaseMailer):
                     branch, recipient
                 )
             else:
-                actual_recipients[
-                    recipient
-                ] = RecipientReason.forBranchSubscriber(
-                    subscription, branch, recipient, rationale
+                actual_recipients[recipient] = (
+                    RecipientReason.forBranchSubscriber(
+                        subscription, branch, recipient, rationale
+                    )
                 )
         if user is not None:
             from_address = format_address_for_person(user)
diff --git a/lib/lp/code/mail/branchmergeproposal.py b/lib/lp/code/mail/branchmergeproposal.py
index 4992286..abd7f27 100644
--- a/lib/lp/code/mail/branchmergeproposal.py
+++ b/lib/lp/code/mail/branchmergeproposal.py
@@ -216,9 +216,9 @@ class BMPMailer(BranchMailer):
                 params["gap"] = "\n\n"
 
         if self.preview_diff is not None and self.preview_diff.oversized:
-            params[
-                "diff_cutoff_warning"
-            ] = "The attached diff has been truncated due to its size.\n"
+            params["diff_cutoff_warning"] = (
+                "The attached diff has been truncated due to its size.\n"
+            )
 
         params["reviews"] = self._getRequestedReviews()
         params["commit_message"] = self._getCommitMessage()
diff --git a/lib/lp/code/mail/tests/test_branch.py b/lib/lp/code/mail/tests/test_branch.py
index c9285fc..c46b00d 100644
--- a/lib/lp/code/mail/tests/test_branch.py
+++ b/lib/lp/code/mail/tests/test_branch.py
@@ -259,9 +259,9 @@ class TestBranchMailerHeadersMixin:
         # Test the email headers for a branch modified email.
         bob = self.factory.makePerson(email="bob@xxxxxxxxxxx")
         branch = self.makeBranch(owner=bob)
-        branch.getSubscription(
-            bob
-        ).notification_level = BranchSubscriptionNotificationLevel.FULL
+        branch.getSubscription(bob).notification_level = (
+            BranchSubscriptionNotificationLevel.FULL
+        )
         switch_dbuser(config.IBranchModifiedMailJobSource.dbuser)
         mailer = BranchMailer.forBranchModified(branch, branch.owner, None)
         mailer.message_id = "<foobar-example-com>"
@@ -282,9 +282,9 @@ class TestBranchMailerHeadersMixin:
         # Test the email headers for new revision email.
         bob = self.factory.makePerson(email="bob@xxxxxxxxxxx")
         branch = self.makeBranch(owner=bob)
-        branch.getSubscription(
-            bob
-        ).notification_level = BranchSubscriptionNotificationLevel.FULL
+        branch.getSubscription(bob).notification_level = (
+            BranchSubscriptionNotificationLevel.FULL
+        )
         switch_dbuser(config.IRevisionsAddedJobSource.dbuser)
         mailer = BranchMailer.forRevision(
             branch,
@@ -426,9 +426,9 @@ class TestBranchMailerSubjectMixin:
         # No string interpolation should occur on the subject.
         branch = self.makeBranch()
         # Subscribe the owner to get revision email.
-        branch.getSubscription(
-            branch.owner
-        ).notification_level = BranchSubscriptionNotificationLevel.FULL
+        branch.getSubscription(branch.owner).notification_level = (
+            BranchSubscriptionNotificationLevel.FULL
+        )
         switch_dbuser(config.IRevisionsAddedJobSource.dbuser)
         mailer = BranchMailer.forRevision(
             branch,
diff --git a/lib/lp/code/model/branchmergeproposal.py b/lib/lp/code/model/branchmergeproposal.py
index 7abdeff..a697a66 100644
--- a/lib/lp/code/model/branchmergeproposal.py
+++ b/lib/lp/code/model/branchmergeproposal.py
@@ -1602,9 +1602,9 @@ class BranchMergeProposal(StormBase, BugLinkTargetMixin):
         diffs = load_related(Diff, preview_diffs, ["diff_id"])
         preview_diff_map = {}
         for previewdiff in preview_diffs:
-            preview_diff_map[
-                previewdiff.branch_merge_proposal_id
-            ] = previewdiff
+            preview_diff_map[previewdiff.branch_merge_proposal_id] = (
+                previewdiff
+            )
         for mp in branch_merge_proposals:
             get_property_cache(mp).preview_diff = preview_diff_map.get(mp.id)
 
diff --git a/lib/lp/code/model/githosting.py b/lib/lp/code/model/githosting.py
index 5ed215a..9a42a4c 100644
--- a/lib/lp/code/model/githosting.py
+++ b/lib/lp/code/model/githosting.py
@@ -275,9 +275,11 @@ class GitHostingClient:
                         path,
                         sources,
                         target,
-                        ""
-                        if previous_target is None
-                        else " (stopping at %s)" % previous_target,
+                        (
+                            ""
+                            if previous_target is None
+                            else " (stopping at %s)" % previous_target
+                        ),
                     )
                 )
             return self._post(
diff --git a/lib/lp/code/model/gitref.py b/lib/lp/code/model/gitref.py
index 9abe5d1..48c8f32 100644
--- a/lib/lp/code/model/gitref.py
+++ b/lib/lp/code/model/gitref.py
@@ -427,20 +427,26 @@ class GitRefMixin:
                     {
                         "sha1": self.commit_sha1,
                         "message": self.commit_message,
-                        "author": None
-                        if self.author is None
-                        else {
-                            "name": self.author.name_without_email,
-                            "email": self.author.email,
-                            "time": seconds_since_epoch(self.author_date),
-                        },
-                        "committer": None
-                        if self.committer is None
-                        else {
-                            "name": self.committer.name_without_email,
-                            "email": self.committer.email,
-                            "time": seconds_since_epoch(self.committer_date),
-                        },
+                        "author": (
+                            None
+                            if self.author is None
+                            else {
+                                "name": self.author.name_without_email,
+                                "email": self.author.email,
+                                "time": seconds_since_epoch(self.author_date),
+                            }
+                        ),
+                        "committer": (
+                            None
+                            if self.committer is None
+                            else {
+                                "name": self.committer.name_without_email,
+                                "email": self.committer.email,
+                                "time": seconds_since_epoch(
+                                    self.committer_date
+                                ),
+                            }
+                        ),
                     }
                 ]
         return log
diff --git a/lib/lp/code/model/tests/test_branchmergeproposaljobs.py b/lib/lp/code/model/tests/test_branchmergeproposaljobs.py
index f1d7889..5edd3fa 100644
--- a/lib/lp/code/model/tests/test_branchmergeproposaljobs.py
+++ b/lib/lp/code/model/tests/test_branchmergeproposaljobs.py
@@ -354,9 +354,9 @@ class TestUpdatePreviewDiffJob(DiffTestCase):
         self.factory.makeRevisionsForBranch(bmp.target_branch, count=1)
         # Kludge a branch being a bit out of date in a way that will make
         # pending_writes true, without anything else failing.
-        removeSecurityProxy(
-            bmp.source_branch
-        ).last_mirrored_id = self.factory.getUniqueString()
+        removeSecurityProxy(bmp.source_branch).last_mirrored_id = (
+            self.factory.getUniqueString()
+        )
         job = UpdatePreviewDiffJob.create(bmp)
         # pop_notifications()
         JobRunner([job]).runAll()
diff --git a/lib/lp/code/model/tests/test_cibuild.py b/lib/lp/code/model/tests/test_cibuild.py
index b80c3e9..78d7f14 100644
--- a/lib/lp/code/model/tests/test_cibuild.py
+++ b/lib/lp/code/model/tests/test_cibuild.py
@@ -504,12 +504,12 @@ class TestCIBuild(TestCaseWithFactory):
 
     def test_getConfiguration_not_found(self):
         build = self.factory.makeCIBuild()
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob.failure = GitRepositoryBlobNotFound(
-            build.git_repository.getInternalPath(),
-            ".launchpad.yaml",
-            rev=build.commit_sha1,
+        self.useFixture(GitHostingFixture()).getBlob.failure = (
+            GitRepositoryBlobNotFound(
+                build.git_repository.getInternalPath(),
+                ".launchpad.yaml",
+                rev=build.commit_sha1,
+            )
         )
         self.assertRaisesWithContent(
             MissingConfiguration,
@@ -520,9 +520,9 @@ class TestCIBuild(TestCaseWithFactory):
 
     def test_getConfiguration_fetch_error(self):
         build = self.factory.makeCIBuild()
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob.failure = GitRepositoryScanFault("Boom")
+        self.useFixture(GitHostingFixture()).getBlob.failure = (
+            GitRepositoryScanFault("Boom")
+        )
         self.assertRaisesWithContent(
             CannotFetchConfiguration,
             "Failed to get .launchpad.yaml from %s: Boom"
diff --git a/lib/lp/code/model/tests/test_gitrepository.py b/lib/lp/code/model/tests/test_gitrepository.py
index b4dbef8..5ab6996 100644
--- a/lib/lp/code/model/tests/test_gitrepository.py
+++ b/lib/lp/code/model/tests/test_gitrepository.py
@@ -2340,9 +2340,9 @@ class TestGitRepositoryRefs(TestCaseWithFactory):
         self.assertEqual(ref.repository, ref_HEAD.repository)
         self.assertEqual("HEAD", ref_HEAD.path)
         self.assertRaises(NotFoundError, getattr, ref_HEAD, "commit_sha1")
-        removeSecurityProxy(
-            ref.repository
-        )._default_branch = "refs/heads/missing"
+        removeSecurityProxy(ref.repository)._default_branch = (
+            "refs/heads/missing"
+        )
         self.assertRaises(NotFoundError, getattr, ref_HEAD, "commit_sha1")
         removeSecurityProxy(ref.repository)._default_branch = ref.path
         self.assertEqual(ref.commit_sha1, ref_HEAD.commit_sha1)
diff --git a/lib/lp/code/model/tests/test_sourcepackagerecipe.py b/lib/lp/code/model/tests/test_sourcepackagerecipe.py
index 715dd9a..08d92b5 100644
--- a/lib/lp/code/model/tests/test_sourcepackagerecipe.py
+++ b/lib/lp/code/model/tests/test_sourcepackagerecipe.py
@@ -123,9 +123,9 @@ class GitMixin:
 
     @staticmethod
     def setInformationType(branch, information_type):
-        removeSecurityProxy(
-            branch
-        ).repository.information_type = information_type
+        removeSecurityProxy(branch).repository.information_type = (
+            information_type
+        )
 
     def makeRecipeText(self):
         branch = self.makeBranch()
diff --git a/lib/lp/code/model/tests/test_sourcepackagerecipebuild.py b/lib/lp/code/model/tests/test_sourcepackagerecipebuild.py
index d08294d..82227d7 100644
--- a/lib/lp/code/model/tests/test_sourcepackagerecipebuild.py
+++ b/lib/lp/code/model/tests/test_sourcepackagerecipebuild.py
@@ -51,9 +51,9 @@ class TestSourcePackageRecipeBuild(TestCaseWithFactory):
         distroseries_i386 = distroseries.newArch(
             "i386", getUtility(IProcessorSet).getByName("386"), False, person
         )
-        removeSecurityProxy(
-            distroseries
-        ).nominatedarchindep = distroseries_i386
+        removeSecurityProxy(distroseries).nominatedarchindep = (
+            distroseries_i386
+        )
         if archive is None:
             archive = self.factory.makeArchive()
 
diff --git a/lib/lp/code/stories/branches/package-branch-merge-proposals.rst b/lib/lp/code/stories/branches/package-branch-merge-proposals.rst
index 41401cf..4d49605 100644
--- a/lib/lp/code/stories/branches/package-branch-merge-proposals.rst
+++ b/lib/lp/code/stories/branches/package-branch-merge-proposals.rst
@@ -18,7 +18,7 @@ branches.
     >>> browser = setupBrowser(auth="Basic eric@xxxxxxxxxxx:test")
     >>> browser.open(b1_url)
     >>> browser.getLink("Propose for merging").click()
-    >>> browser.getControl(
-    ...     name="field.target_branch.target_branch"
-    ... ).value = b2_name
+    >>> browser.getControl(name="field.target_branch.target_branch").value = (
+    ...     b2_name
+    ... )
     >>> browser.getControl("Propose Merge").click()
diff --git a/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst b/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst
index eeb9b40..fc70eb3 100644
--- a/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst
+++ b/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst
@@ -27,9 +27,9 @@ with a product branch.
     >>> browser = setupBrowser(auth="Basic eric@xxxxxxxxxxx:test")
     >>> browser.open(b1_url)
     >>> browser.getLink("Propose for merging").click()
-    >>> browser.getControl(
-    ...     name="field.target_branch.target_branch"
-    ... ).value = b2_name
+    >>> browser.getControl(name="field.target_branch.target_branch").value = (
+    ...     b2_name
+    ... )
     >>> browser.getControl("Propose Merge").click()
 
     >>> print_errors(browser.contents)
@@ -47,7 +47,7 @@ Linking the packages makes this possible.
 
     >>> browser.open(b1_url)
     >>> browser.getLink("Propose for merging").click()
-    >>> browser.getControl(
-    ...     name="field.target_branch.target_branch"
-    ... ).value = b2_name
+    >>> browser.getControl(name="field.target_branch.target_branch").value = (
+    ...     b2_name
+    ... )
     >>> browser.getControl("Propose Merge").click()
diff --git a/lib/lp/code/stories/branches/xx-branch-edit.rst b/lib/lp/code/stories/branches/xx-branch-edit.rst
index e6a8443..35d0af4 100644
--- a/lib/lp/code/stories/branches/xx-branch-edit.rst
+++ b/lib/lp/code/stories/branches/xx-branch-edit.rst
@@ -54,9 +54,9 @@ Then, post the changes to the summary. Also add a trailing slash to the
 URL.
 
     >>> browser.getControl("Branch URL").value += "/"
-    >>> browser.getControl(
-    ...     "Description"
-    ... ).value = "Klingon support for Gnome Terminal"
+    >>> browser.getControl("Description").value = (
+    ...     "Klingon support for Gnome Terminal"
+    ... )
     >>> browser.getControl("Change Branch").click()
 
 We should be redirected to the branch page, check that our changes were
@@ -212,9 +212,9 @@ Edit forms do the same URL validation checks as the add forms.
 
     >>> browser.open("http://code.launchpad.test/~name12/gnome-terminal/main";)
     >>> browser.getLink("Change branch details").click()
-    >>> browser.getControl(
-    ...     "Branch URL"
-    ... ).value = "http://bazaar.launchpad.test/~foo/bar/baz";
+    >>> browser.getControl("Branch URL").value = (
+    ...     "http://bazaar.launchpad.test/~foo/bar/baz";
+    ... )
     >>> browser.getControl("Change Branch").click()
 
     >>> print_feedback_messages(browser.contents)
@@ -228,9 +228,9 @@ Check that when editing a hosted branch the URL field is not shown.
     ...     "http://code.launchpad.test/~name12/gnome-terminal/scanned";
     ... )
     >>> browser.getLink("Change branch details").click()
-    >>> browser.getControl(
-    ...     "Branch URL"
-    ... ).value = "http://acme.example.com/~foo/bar/baz";
+    >>> browser.getControl("Branch URL").value = (
+    ...     "http://acme.example.com/~foo/bar/baz";
+    ... )
     Traceback (most recent call last):
     ...
     LookupError: label ...'Branch URL'
diff --git a/lib/lp/code/stories/branches/xx-branch-listings.rst b/lib/lp/code/stories/branches/xx-branch-listings.rst
index 95ecebc..dbc43b2 100644
--- a/lib/lp/code/stories/branches/xx-branch-listings.rst
+++ b/lib/lp/code/stories/branches/xx-branch-listings.rst
@@ -404,9 +404,9 @@ development focus branch.
 
     >>> admin_browser.open("http://launchpad.test/gnome-terminal/trunk";)
     >>> admin_browser.getLink("Link to branch").click()
-    >>> admin_browser.getControl(
-    ...     name="field.branch_location"
-    ... ).value = "~name12/gnome-terminal/main"
+    >>> admin_browser.getControl(name="field.branch_location").value = (
+    ...     "~name12/gnome-terminal/main"
+    ... )
     >>> admin_browser.getControl("Update").click()
 
 Now when we look at the branches for gnome-terminal, the main branch
@@ -430,18 +430,18 @@ are comma separated and in alphabetical order.
     >>> admin_browser.getLink("Register a series").click()
     >>> admin_browser.getControl("Name").value = "pre-1.0"
     >>> admin_browser.getControl("Summary").value = "summary"
-    >>> admin_browser.getControl(
-    ...     "Branch"
-    ... ).value = "~name12/gnome-terminal/main"
+    >>> admin_browser.getControl("Branch").value = (
+    ...     "~name12/gnome-terminal/main"
+    ... )
     >>> admin_browser.getControl("Register Series").click()
 
     >>> admin_browser.open("http://launchpad.test/gnome-terminal";)
     >>> admin_browser.getLink("Register a series").click()
     >>> admin_browser.getControl("Name").value = "alpha"
     >>> admin_browser.getControl("Summary").value = "summary"
-    >>> admin_browser.getControl(
-    ...     "Branch"
-    ... ).value = "~name12/gnome-terminal/main"
+    >>> admin_browser.getControl("Branch").value = (
+    ...     "~name12/gnome-terminal/main"
+    ... )
     >>> admin_browser.getControl("Register Series").click()
 
 The current development focus is shown first though.
diff --git a/lib/lp/code/stories/branches/xx-branchmergeproposals.rst b/lib/lp/code/stories/branches/xx-branchmergeproposals.rst
index fac9d1c..682badb 100644
--- a/lib/lp/code/stories/branches/xx-branchmergeproposals.rst
+++ b/lib/lp/code/stories/branches/xx-branchmergeproposals.rst
@@ -69,9 +69,9 @@ Logged in users can register a merge proposal.
     >>> nopriv_browser.getControl(
     ...     name="field.target_branch.target_branch"
     ... ).value = "~name12/gnome-terminal/main"
-    >>> nopriv_browser.getControl(
-    ...     name="field.prerequisite_branch"
-    ... ).value = "~name12/gnome-terminal/pushed"
+    >>> nopriv_browser.getControl(name="field.prerequisite_branch").value = (
+    ...     "~name12/gnome-terminal/pushed"
+    ... )
     >>> print_tag_with_id(nopriv_browser.contents, "field.reviewer")
     <BLANKLINE>
 
@@ -117,9 +117,9 @@ Since the plan is to merge a branch into another branch, it makes sense that a
 commit message can be set.
 
     >>> nopriv_browser.getLink(url="edit-commit-message").click()
-    >>> nopriv_browser.getControl(
-    ...     name="field.commit_message"
-    ... ).value = "Add more <b>mojo</b>"
+    >>> nopriv_browser.getControl(name="field.commit_message").value = (
+    ...     "Add more <b>mojo</b>"
+    ... )
     >>> nopriv_browser.getControl("Update").click()
 
     >>> print_tag_with_id(nopriv_browser.contents, "edit-commit_message")
@@ -219,9 +219,9 @@ People who are logged in can perform reviews.
 
     >>> nopriv_browser.open(klingon_proposal)
     >>> nopriv_browser.getLink("Add a review or comment").click()
-    >>> nopriv_browser.getControl(
-    ...     name="field.comment"
-    ... ).value = "Don't like it"
+    >>> nopriv_browser.getControl(name="field.comment").value = (
+    ...     "Don't like it"
+    ... )
     >>> nopriv_browser.getControl(name="field.vote").getControl(
     ...     "Disapprove"
     ... ).click()
@@ -438,9 +438,9 @@ is shown.
 
     >>> admin_browser.open("http://launchpad.test/firefox/trunk";)
     >>> admin_browser.getLink("Link to branch").click()
-    >>> admin_browser.getControl(
-    ...     name="field.branch_location"
-    ... ).value = "~name12/firefox/main"
+    >>> admin_browser.getControl(name="field.branch_location").value = (
+    ...     "~name12/firefox/main"
+    ... )
     >>> admin_browser.getControl("Update").click()
 
     # Just show the radio buttons for the branch widgets.
diff --git a/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst b/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst
index 3da38a6..9961c24 100644
--- a/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst
+++ b/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst
@@ -25,9 +25,9 @@ Logging in as an admin helps with setting things up.
     >>> eric_browser = setupBrowser(auth="Basic eric@xxxxxxxxxxx:test")
     >>> eric_browser.open(branch_url)
     >>> eric_browser.getLink("Propose for merging").click()
-    >>> eric_browser.getControl(
-    ...     "Description of the change"
-    ... ).value = "This fix is awesome!"
+    >>> eric_browser.getControl("Description of the change").value = (
+    ...     "This fix is awesome!"
+    ... )
     >>> eric_browser.getControl("Propose Merge").click()
 
 The reviewer table shows both the Vikings team and Eric himself.
diff --git a/lib/lp/code/stories/branches/xx-private-branch-listings.rst b/lib/lp/code/stories/branches/xx-private-branch-listings.rst
index 8f24d0d..d76ceec 100644
--- a/lib/lp/code/stories/branches/xx-private-branch-listings.rst
+++ b/lib/lp/code/stories/branches/xx-private-branch-listings.rst
@@ -249,9 +249,9 @@ There are no branches linked to this bug.
 Now link to a private branch.
 
     >>> landscape_dev_browser.getLink("Link a related branch").click()
-    >>> landscape_dev_browser.getControl(
-    ...     "Branch"
-    ... ).value = "~landscape-developers/landscape/trunk"
+    >>> landscape_dev_browser.getControl("Branch").value = (
+    ...     "~landscape-developers/landscape/trunk"
+    ... )
     >>> landscape_dev_browser.getControl("Continue").click()
     >>> printBugBranchLinks(landscape_dev_browser)
     lp://dev/~landscape-developers/landscape/trunk
@@ -273,9 +273,9 @@ those who shouldn't be able to see it.
 
     >>> admin_browser.open("http://launchpad.test/landscape/trunk";)
     >>> admin_browser.getLink("Change details").click()
-    >>> admin_browser.getControl(
-    ...     "Branch"
-    ... ).value = "~landscape-developers/landscape/trunk"
+    >>> admin_browser.getControl("Branch").value = (
+    ...     "~landscape-developers/landscape/trunk"
+    ... )
     >>> admin_browser.getControl("Change").click()
 
 Since the admin user is able to see all private branches the branch details
diff --git a/lib/lp/code/stories/branches/xx-product-branches.rst b/lib/lp/code/stories/branches/xx-product-branches.rst
index 7e99fe2..1785058 100644
--- a/lib/lp/code/stories/branches/xx-product-branches.rst
+++ b/lib/lp/code/stories/branches/xx-product-branches.rst
@@ -133,9 +133,9 @@ once, but both series are shown in the listing.
 Firstly lets associate release--0.9.1 with the 1.0 series.
 
     >>> admin_browser.open("http://launchpad.test/firefox/1.0/+setbranch";)
-    >>> admin_browser.getControl(
-    ...     "Branch:"
-    ... ).value = "~mark/firefox/release--0.9.1"
+    >>> admin_browser.getControl("Branch:").value = (
+    ...     "~mark/firefox/release--0.9.1"
+    ... )
     >>> admin_browser.getControl("Update").click()
 
     >>> browser.open("http://code.launchpad.test/firefox";)
diff --git a/lib/lp/code/stories/codeimport/xx-admin-codeimport.rst b/lib/lp/code/stories/codeimport/xx-admin-codeimport.rst
index aabece2..84b4f82 100644
--- a/lib/lp/code/stories/codeimport/xx-admin-codeimport.rst
+++ b/lib/lp/code/stories/codeimport/xx-admin-codeimport.rst
@@ -167,9 +167,9 @@ url.
 This is true for Subversion imports,
 
     >>> import_browser.open(svn_import_location + "/+edit-import")
-    >>> import_browser.getControl(
-    ...     "URL"
-    ... ).value = "svn://user:password@xxxxxxxxxxxxxxxxxxx/fooix/trunk"
+    >>> import_browser.getControl("URL").value = (
+    ...     "svn://user:password@xxxxxxxxxxxxxxxxxxx/fooix/trunk"
+    ... )
     >>> import_browser.getControl("Update").click()
     >>> print_feedback_messages(import_browser.contents)
     The code import has been updated.
@@ -177,9 +177,9 @@ This is true for Subversion imports,
 bzr-svn imports,
 
     >>> import_browser.open(bzr_svn_import_location + "/+edit-import")
-    >>> import_browser.getControl(
-    ...     "URL"
-    ... ).value = "svn://user:password@xxxxxxxxxxxxxxxxxxx/bzr-svn/trunk"
+    >>> import_browser.getControl("URL").value = (
+    ...     "svn://user:password@xxxxxxxxxxxxxxxxxxx/bzr-svn/trunk"
+    ... )
     >>> import_browser.getControl("Update").click()
     >>> print_feedback_messages(import_browser.contents)
     The code import has been updated.
@@ -187,9 +187,9 @@ bzr-svn imports,
 CVS imports,
 
     >>> import_browser.open(cvs_import_location + "/+edit-import")
-    >>> import_browser.getControl(
-    ...     "Repository"
-    ... ).value = ":pserver:anonymous@xxxxxxxxxxxxxxxxxxx:/fooix"
+    >>> import_browser.getControl("Repository").value = (
+    ...     ":pserver:anonymous@xxxxxxxxxxxxxxxxxxx:/fooix"
+    ... )
     >>> import_browser.getControl("Module").value = "fooix2"
     >>> import_browser.getControl("Update").click()
     >>> print_feedback_messages(import_browser.contents)
@@ -198,9 +198,9 @@ CVS imports,
 Git-to-Bazaar imports,
 
     >>> import_browser.open(git_import_location + "/+edit-import")
-    >>> import_browser.getControl(
-    ...     "URL"
-    ... ).value = "git://user:password@xxxxxxxxxxxxxxxxxxx/fooix"
+    >>> import_browser.getControl("URL").value = (
+    ...     "git://user:password@xxxxxxxxxxxxxxxxxxx/fooix"
+    ... )
     >>> import_browser.getControl("Update").click()
     >>> print_feedback_messages(import_browser.contents)
     The code import has been updated.
@@ -208,9 +208,9 @@ Git-to-Bazaar imports,
 Git-to-Git imports,
 
     >>> import_browser.open(git_to_git_import_location + "/+edit-import")
-    >>> import_browser.getControl(
-    ...     "URL"
-    ... ).value = "git://user:password@xxxxxxxxxxxxxxxxxxx/fooix2"
+    >>> import_browser.getControl("URL").value = (
+    ...     "git://user:password@xxxxxxxxxxxxxxxxxxx/fooix2"
+    ... )
     >>> import_browser.getControl("Update").click()
     >>> print_feedback_messages(import_browser.contents)
     The code import has been updated.
@@ -218,9 +218,9 @@ Git-to-Git imports,
 and imports targeting source packages.
 
     >>> import_browser.open(package_import_location + "/+edit-import")
-    >>> import_browser.getControl(
-    ...     "URL"
-    ... ).value = "http://metal.example.org/zap";
+    >>> import_browser.getControl("URL").value = (
+    ...     "http://metal.example.org/zap";
+    ... )
     >>> import_browser.getControl("Update").click()
     >>> print_feedback_messages(import_browser.contents)
     The code import has been updated.
diff --git a/lib/lp/code/stories/codeimport/xx-create-codeimport.rst b/lib/lp/code/stories/codeimport/xx-create-codeimport.rst
index 6ad51a8..184fe0b 100644
--- a/lib/lp/code/stories/codeimport/xx-create-codeimport.rst
+++ b/lib/lp/code/stories/codeimport/xx-create-codeimport.rst
@@ -44,9 +44,9 @@ importing will be available to any user.
     >>> owner_browser.getLink("Configure Code").click()
     >>> owner_browser.getControl("Bazaar", index=0).click()
     >>> owner_browser.getControl("Import a branch").click()
-    >>> owner_browser.getControl(
-    ...     "Branch URL"
-    ... ).value = "git://example.com/firefox"
+    >>> owner_browser.getControl("Branch URL").value = (
+    ...     "git://example.com/firefox"
+    ... )
     >>> owner_browser.getControl("Git", index=1).click()
     >>> owner_browser.getControl("Branch name").value = "trunk"
     >>> owner_browser.getControl("Update").click()
@@ -71,9 +71,9 @@ The user is required to enter a project that the import is for, a name
 for the import branch, and a Bazaar branch location.
 
     >>> browser.getControl("Name").value = "mirrored"
-    >>> browser.getControl(
-    ...     "Branch URL", index=0
-    ... ).value = "http://bzr.example.com/firefox/trunk";
+    >>> browser.getControl("Branch URL", index=0).value = (
+    ...     "http://bzr.example.com/firefox/trunk";
+    ... )
     >>> browser.getControl("Request Import").click()
 
 When the user clicks continue, the import branch is created
@@ -96,9 +96,9 @@ URL.
 
     >>> browser.open("http://code.launchpad.test/+code-imports/+new";)
     >>> browser.getControl("Name").value = "with-password"
-    >>> browser.getControl(
-    ...     "Branch URL", index=0
-    ... ).value = "http://user:password@xxxxxxxxxxxxxxx/firefox/trunk";
+    >>> browser.getControl("Branch URL", index=0).value = (
+    ...     "http://user:password@xxxxxxxxxxxxxxx/firefox/trunk";
+    ... )
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Request Import").click()
     >>> print(
@@ -115,9 +115,9 @@ Specifying a Launchpad URL results in an error.
 
     >>> browser.open("http://code.launchpad.test/+code-imports/+new";)
     >>> browser.getControl("Name").value = "invalid"
-    >>> browser.getControl(
-    ...     "Branch URL", index=0
-    ... ).value = "http://bazaar.launchpad.net/firefox/trunk";
+    >>> browser.getControl("Branch URL", index=0).value = (
+    ...     "http://bazaar.launchpad.net/firefox/trunk";
+    ... )
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Request Import").click()
     >>> print_feedback_messages(browser.contents)
@@ -131,9 +131,9 @@ But a Launchpad Git URL is OK.
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Name").value = "lp-git-import"
     >>> browser.getControl("Git", index=0).click()
-    >>> browser.getControl(
-    ...     "Repo URL", index=0
-    ... ).value = "git://git.launchpad.net/firefox.git"
+    >>> 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"))
@@ -154,9 +154,9 @@ a name for the import branch, and a subversion branch location.
     >>> browser.getControl("Subversion").click()
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Name").value = "imported"
-    >>> browser.getControl(
-    ...     "Branch URL", index=1
-    ... ).value = "http://svn.example.com/firefox/trunk";
+    >>> browser.getControl("Branch URL", index=1).value = (
+    ...     "http://svn.example.com/firefox/trunk";
+    ... )
     >>> browser.getControl("Request Import").click()
 
 When the user clicks continue, the import branch is created
@@ -189,9 +189,9 @@ URL.
     >>> browser.open("http://code.launchpad.test/+code-imports/+new";)
     >>> browser.getControl("Subversion").click()
     >>> browser.getControl("Name").value = "svn-with-password"
-    >>> browser.getControl(
-    ...     "Branch URL", index=1
-    ... ).value = "http://user:password@xxxxxxxxxxxxxxx/firefox/trunk";
+    >>> browser.getControl("Branch URL", index=1).value = (
+    ...     "http://user:password@xxxxxxxxxxxxxxx/firefox/trunk";
+    ... )
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Request Import").click()
     >>> print(
@@ -215,9 +215,9 @@ a name for the import branch, and a Git repository location.
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Name").value = "git-import"
     >>> browser.getControl("Git", index=0).click()
-    >>> browser.getControl(
-    ...     "Repo URL", index=0
-    ... ).value = "git://example.com/firefox.git"
+    >>> browser.getControl("Repo URL", index=0).value = (
+    ...     "git://example.com/firefox.git"
+    ... )
     >>> browser.getControl("Request Import").click()
 
 When the user clicks continue, the approved import branch is created.
@@ -246,9 +246,9 @@ allowed to match that of an existing Bazaar-targeted import.
     >>> browser.getControl("Name").value = "upstream"
     >>> browser.getControl("Git", index=0).click()
     >>> browser.getControl("Git", index=1).click()
-    >>> browser.getControl(
-    ...     "Repo URL", index=0
-    ... ).value = "git://example.com/firefox.git"
+    >>> browser.getControl("Repo URL", index=0).value = (
+    ...     "git://example.com/firefox.git"
+    ... )
     >>> with GitHostingFixture():
     ...     browser.getControl("Request Import").click()
     ...
@@ -275,9 +275,9 @@ to identify the CVS branch.  A project and branch name are also required.
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Name").value = "import2"
     >>> browser.getControl("CVS").click()
-    >>> browser.getControl(
-    ...     "Repository"
-    ... ).value = ":pserver:anonymous@xxxxxxxxxxxxxxx:/mozilla/cvs"
+    >>> browser.getControl("Repository").value = (
+    ...     ":pserver:anonymous@xxxxxxxxxxxxxxx:/mozilla/cvs"
+    ... )
     >>> browser.getControl("Module").value = "firefox"
     >>> browser.getControl("Request Import").click()
 
@@ -301,9 +301,9 @@ purposes.
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Name").value = "import2"
     >>> browser.getControl("CVS").click()
-    >>> browser.getControl(
-    ...     "Repository"
-    ... ).value = ":anonymous@xxxxxxxxxxxxxxx:/mozilla/cvs"
+    >>> browser.getControl("Repository").value = (
+    ...     ":anonymous@xxxxxxxxxxxxxxx:/mozilla/cvs"
+    ... )
     >>> browser.getControl("Module").value = "firefox"
     >>> browser.getControl("Request Import").click()
 
@@ -325,9 +325,9 @@ The error is shown even if the project is different.
     >>> browser.getControl("Project").value = "thunderbird"
     >>> browser.getControl("Name").value = "imported"
     >>> browser.getControl("CVS").click()
-    >>> browser.getControl(
-    ...     "Repository"
-    ... ).value = ":pserver:anonymous@xxxxxxxxxxxxxxx:/mozilla/cvs"
+    >>> browser.getControl("Repository").value = (
+    ...     ":pserver:anonymous@xxxxxxxxxxxxxxx:/mozilla/cvs"
+    ... )
     >>> browser.getControl("Module").value = "firefox"
     >>> browser.getControl("Request Import").click()
 
@@ -337,9 +337,9 @@ The error is shown even if the project is different.
     the imported branch ~no-priv/firefox/import2.
 
     >>> browser.getControl("Subversion").click()
-    >>> browser.getControl(
-    ...     "Branch URL", index=1
-    ... ).value = "http://svn.example.com/firefox/trunk";
+    >>> browser.getControl("Branch URL", index=1).value = (
+    ...     "http://svn.example.com/firefox/trunk";
+    ... )
     >>> browser.getControl("Request Import").click()
 
     >>> print_feedback_messages(browser.contents)
@@ -360,9 +360,9 @@ one.
     >>> browser.getControl("Subversion").click()
     >>> browser.getControl("Project").value = "firefox"
     >>> browser.getControl("Name").value = "imported"
-    >>> browser.getControl(
-    ...     "Branch URL", index=1
-    ... ).value = "http://svn.example.com/firefox/other";
+    >>> browser.getControl("Branch URL", index=1).value = (
+    ...     "http://svn.example.com/firefox/other";
+    ... )
     >>> browser.getControl("Request Import").click()
     >>> print_feedback_messages(browser.contents)
     There is 1 error.
@@ -378,9 +378,9 @@ then an error is shown to the user.
     >>> browser.open("http://code.launchpad.test/+code-imports/+new";)
     >>> browser.getControl("Project").value = "launchpad"
     >>> browser.getControl("Name").value = "imported"
-    >>> browser.getControl(
-    ...     "Branch URL", index=0
-    ... ).value = "http://svn.example.com/launchpage/fake";
+    >>> browser.getControl("Branch URL", index=0).value = (
+    ...     "http://svn.example.com/launchpage/fake";
+    ... )
     >>> browser.getControl("Request Import").click()
     >>> print_feedback_messages(browser.contents)
     There is 1 error.
@@ -396,9 +396,9 @@ existing product, an error is shown to the user.
     >>> browser.open("http://code.launchpad.test/+code-imports/+new";)
     >>> browser.getControl("Project").value = "no-such-product"
     >>> browser.getControl("Name").value = "imported"
-    >>> browser.getControl(
-    ...     "Branch URL", index=0
-    ... ).value = "http://svn.example.com/launchpage/fake";
+    >>> browser.getControl("Branch URL", index=0).value = (
+    ...     "http://svn.example.com/launchpage/fake";
+    ... )
     >>> browser.getControl("Request Import").click()
     >>> print_feedback_messages(browser.contents)
     There is 1 error.
@@ -423,9 +423,9 @@ Change the owner to be a team that sample person is a member of.
     >>> sample_browser.getControl("Owner").value = ["landscape-developers"]
     >>> sample_browser.getControl("Owner").displayValue
     ['Landscape Developers (landscape-developers)']
-    >>> sample_browser.getControl(
-    ...     "Branch URL", index=0
-    ... ).value = "http://svn.example.com/firefox-beta/trunk";
+    >>> sample_browser.getControl("Branch URL", index=0).value = (
+    ...     "http://svn.example.com/firefox-beta/trunk";
+    ... )
     >>> sample_browser.getControl("Request Import").click()
 
     >>> print_tag_with_id(sample_browser.contents, "registration")
@@ -438,9 +438,9 @@ Admins can specify any owner for a new code import.
     >>> admin_browser = setupBrowser(auth="Basic admin@xxxxxxxxxxxxx:test")
     >>> admin_browser.open("http://code.launchpad.test/firefox/+new-import";)
     >>> admin_browser.getControl("Owner").value = "mark"
-    >>> admin_browser.getControl(
-    ...     "Branch URL", index=0
-    ... ).value = "http://svn.example.com/firefox-theta/trunk";
+    >>> admin_browser.getControl("Branch URL", index=0).value = (
+    ...     "http://svn.example.com/firefox-theta/trunk";
+    ... )
     >>> admin_browser.getControl("Request Import").click()
 
     >>> print_tag_with_id(admin_browser.contents, "registration")
diff --git a/lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py b/lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py
index afbdbdf..0a4cc4e 100644
--- a/lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py
+++ b/lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py
@@ -67,9 +67,9 @@ class TestGitRefVocabulary(TestCaseWithFactory):
                 "refs/tags/next-1.0",
             ]
         )
-        removeSecurityProxy(
-            ref_master.repository
-        )._default_branch = ref_master.path
+        removeSecurityProxy(ref_master.repository)._default_branch = (
+            ref_master.path
+        )
         vocab = self.vocabulary_class(ref_master.repository)
         self.assertContentEqual(
             [term.value.path for term in vocab.searchForTerms("master")],
@@ -117,9 +117,9 @@ class TestGitRefVocabulary(TestCaseWithFactory):
                 "refs/heads/master-older",
             ]
         )
-        removeSecurityProxy(
-            ref_master.repository
-        )._default_branch = ref_master.path
+        removeSecurityProxy(ref_master.repository)._default_branch = (
+            ref_master.path
+        )
         now = datetime.now(timezone.utc)
         removeSecurityProxy(ref_master_old).committer_date = now - timedelta(
             days=1
@@ -197,9 +197,9 @@ class TestGitBranchVocabulary(TestCaseWithFactory):
                 "refs/tags/next-1.0",
             ]
         )
-        removeSecurityProxy(
-            ref_master.repository
-        )._default_branch = ref_master.path
+        removeSecurityProxy(ref_master.repository)._default_branch = (
+            ref_master.path
+        )
         vocab = self.vocabulary_class(ref_master.repository)
         self.assertContentEqual(
             [term.title for term in vocab.searchForTerms("master")], ["master"]
@@ -234,9 +234,9 @@ class TestGitBranchVocabulary(TestCaseWithFactory):
                 "refs/heads/master-older",
             ]
         )
-        removeSecurityProxy(
-            ref_master.repository
-        )._default_branch = ref_master.path
+        removeSecurityProxy(ref_master.repository)._default_branch = (
+            ref_master.path
+        )
         now = datetime.now(timezone.utc)
         removeSecurityProxy(ref_master_old).committer_date = now - timedelta(
             days=1
diff --git a/lib/lp/codehosting/bzrutils.py b/lib/lp/codehosting/bzrutils.py
index c3e1d32..9a637a6 100644
--- a/lib/lp/codehosting/bzrutils.py
+++ b/lib/lp/codehosting/bzrutils.py
@@ -315,13 +315,13 @@ def get_branch_info(branch):
     # XXX: Aaron Bentley 2008-06-13
     # Bazaar does not provide a public API for learning about
     # format markers.  Fix this in Bazaar, then here.
-    info[
-        "control_string"
-    ] = branch.controldir._format.get_format_string().decode()
+    info["control_string"] = (
+        branch.controldir._format.get_format_string().decode()
+    )
     info["branch_string"] = branch._format.get_format_string().decode()
-    info[
-        "repository_string"
-    ] = branch.repository._format.get_format_string().decode()
+    info["repository_string"] = (
+        branch.repository._format.get_format_string().decode()
+    )
     return info
 
 
diff --git a/lib/lp/codehosting/vfs/tests/test_branchfs.py b/lib/lp/codehosting/vfs/tests/test_branchfs.py
index 5a7f958..e472924 100644
--- a/lib/lp/codehosting/vfs/tests/test_branchfs.py
+++ b/lib/lp/codehosting/vfs/tests/test_branchfs.py
@@ -168,10 +168,10 @@ class TestTransportDispatch(TestCase):
     def test_makeTransport_control(self):
         # makeTransport returns a control transport for the tuple.
         log = []
-        self.factory._transport_factories[
-            CONTROL_TRANSPORT
-        ] = lambda default_stack_on, trailing_path: log.append(
-            default_stack_on
+        self.factory._transport_factories[CONTROL_TRANSPORT] = (
+            lambda default_stack_on, trailing_path: log.append(
+                default_stack_on
+            )
         )
         transport, path = self.factory.makeTransport(
             (CONTROL_TRANSPORT, {"default_stack_on": "foo"}, "bar/baz")
@@ -182,9 +182,9 @@ class TestTransportDispatch(TestCase):
     def test_makeTransport_branch(self):
         # makeTransport returns a control transport for the tuple.
         log = []
-        self.factory._transport_factories[
-            BRANCH_TRANSPORT
-        ] = lambda id, writable, trailing_path: log.append((id, writable))
+        self.factory._transport_factories[BRANCH_TRANSPORT] = (
+            lambda id, writable, trailing_path: log.append((id, writable))
+        )
         transport, path = self.factory.makeTransport(
             (BRANCH_TRANSPORT, {"id": 1, "writable": True}, "bar/baz")
         )
diff --git a/lib/lp/coop/answersbugs/stories/question-makebug.rst b/lib/lp/coop/answersbugs/stories/question-makebug.rst
index 18defa3..64707f9 100644
--- a/lib/lp/coop/answersbugs/stories/question-makebug.rst
+++ b/lib/lp/coop/answersbugs/stories/question-makebug.rst
@@ -36,12 +36,12 @@ bug.
 Clicking the 'Create' button creates the bug with the user-specified title
 and description and redirects the user to the bug page.
 
-    >>> browser.getControl(
-    ...     "Summary"
-    ... ).value = "W3C SVG demo doesn't work in Firefox"
-    >>> browser.getControl(
-    ...     "Description"
-    ... ).value = "Browsing to the W3C SVG demo results in a blank page."
+    >>> browser.getControl("Summary").value = (
+    ...     "W3C SVG demo doesn't work in Firefox"
+    ... )
+    >>> browser.getControl("Description").value = (
+    ...     "Browsing to the W3C SVG demo results in a blank page."
+    ... )
     >>> browser.getControl("Create").click()
     >>> browser.url
     '.../firefox/+bug/...'
@@ -80,9 +80,9 @@ to it.
 It works with distribution questions as well.
 
     >>> browser.open("http://launchpad.test/ubuntu/+question/5/+makebug";)
-    >>> browser.getControl(
-    ...     "Summary"
-    ... ).value = "Ubuntu Installer can't find CDROM"
+    >>> browser.getControl("Summary").value = (
+    ...     "Ubuntu Installer can't find CDROM"
+    ... )
     >>> browser.getControl("Create Bug Report").click()
     >>> browser.url
     '.../ubuntu/+bug/...'
diff --git a/lib/lp/coop/answersbugs/tests/test_doc.py b/lib/lp/coop/answersbugs/tests/test_doc.py
index 2547ef0..56fc4bc 100644
--- a/lib/lp/coop/answersbugs/tests/test_doc.py
+++ b/lib/lp/coop/answersbugs/tests/test_doc.py
@@ -66,9 +66,9 @@ def bugLinkedToQuestionSetUp(test):
 
     setUp(test)
     bugtask_id = _createUbuntuBugTaskLinkedToQuestion()
-    test.globs[
-        "get_bugtask_linked_to_question"
-    ] = get_bugtask_linked_to_question
+    test.globs["get_bugtask_linked_to_question"] = (
+        get_bugtask_linked_to_question
+    )
     # Log in here, since we don't want to set up an non-anonymous
     # interaction in the test.
     login("no-priv@xxxxxxxxxxxxx")
diff --git a/lib/lp/oci/browser/tests/test_ocirecipe.py b/lib/lp/oci/browser/tests/test_ocirecipe.py
index bb11c3c..60ecc0d 100644
--- a/lib/lp/oci/browser/tests/test_ocirecipe.py
+++ b/lib/lp/oci/browser/tests/test_ocirecipe.py
@@ -212,9 +212,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser.getControl(name="field.name").value = "recipe-name"
         browser.getControl("Description").value = "Recipe description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
         browser.getControl("Create OCI recipe").click()
 
@@ -291,9 +291,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser.getControl(name="field.name").value = "recipe-name"
         browser.getControl("Description").value = "Recipe description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
         browser.getControl("Create OCI recipe").click()
         self.assertIn("Branch does not match format", browser.contents)
@@ -308,13 +308,13 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser.getControl(name="field.name").value = "recipe-name"
         browser.getControl("Description").value = "Recipe description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
-        browser.getControl(
-            "Build-time ARG variables"
-        ).value = "VAR1=10\nVAR2=20"
+        browser.getControl("Build-time ARG variables").value = (
+            "VAR1=10\nVAR2=20"
+        )
         browser.getControl("Create OCI recipe").click()
 
         content = find_main_content(browser.contents)
@@ -337,9 +337,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser.getControl(name="field.name").value = "recipe-name"
         browser.getControl("Description").value = "Recipe description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
 
         image_name = self.factory.getUniqueUnicode()
@@ -413,9 +413,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         processors = browser.getControl(name="field.processors")
         processors.value = ["386", "amd64"]
         browser.getControl(name="field.name").value = "recipe-name"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
         browser.getControl("Create OCI recipe").click()
         login_person(self.person)
@@ -513,9 +513,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser.getControl(name="field.name").value = "recipe-name"
         browser.getControl("Description").value = "Recipe description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
         official_control = browser.getControl("Official recipe")
         official_control.selected = True
@@ -547,9 +547,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser.getControl(name="field.name").value = "recipe-name"
         browser.getControl("Description").value = "Recipe description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
         official_control = browser.getControl("Official recipe")
         official_control.selected = True
@@ -565,9 +565,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser2.getControl(name="field.name").value = "recipe-name"
         browser2.getControl("Description").value = "Recipe description"
-        browser2.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref2_identity
+        browser2.getControl(name="field.git_ref.repository").value = (
+            git_ref2_identity
+        )
         browser2.getControl(name="field.git_ref.path").value = git_ref2_path
         official_control = browser2.getControl("Official recipe")
         official_control.selected = True
@@ -598,9 +598,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser.getControl(name="field.name").value = "recipe-name"
         browser.getControl("Description").value = "Recipe description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
         official_control = browser.getControl("Official recipe")
         official_control.selected = True
@@ -621,9 +621,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         )
         browser.getControl(name="field.name").value = "recipe-name"
         browser.getControl("Description").value = "Recipe description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = "non-exist"
         browser.getControl("Create OCI recipe").click()
 
@@ -786,9 +786,9 @@ class TestOCIRecipeEditView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
         browser.getControl("Owner").value = ["new-team"]
         browser.getControl(name="field.name").value = "new-name"
         browser.getControl("Description").value = "New description"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = new_git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            new_git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = new_git_ref_path
         browser.getControl("Build file path").value = "Dockerfile-2"
         browser.getControl("Build directory context").value = "apath"
@@ -840,9 +840,9 @@ class TestOCIRecipeEditView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
 
         browser = self.getViewBrowser(recipe, user=self.person)
         browser.getLink("Edit OCI recipe").click()
-        browser.getControl(
-            name="field.git_ref.path"
-        ).value = "refs/heads/invalid"
+        browser.getControl(name="field.git_ref.path").value = (
+            "refs/heads/invalid"
+        )
         browser.getControl("Update OCI recipe").click()
         self.assertIn("Branch does not match format", browser.contents)
 
@@ -2572,9 +2572,9 @@ class TestOCIRecipeEditPushRulesView(
         browser = self.getViewBrowser(self.recipe, user=self.person)
         browser.getLink("Edit push rules").click()
         with person_logged_in(self.person):
-            browser.getControl(
-                name="field.delete.%d" % push_rule_id
-            ).value = True
+            browser.getControl(name="field.delete.%d" % push_rule_id).value = (
+                True
+            )
         browser.getControl("Save").click()
 
         with person_logged_in(self.person):
@@ -2653,9 +2653,9 @@ class TestOCIRecipeEditPushRulesView(
         browser.getControl(name="field.add_region").value = "somewhere-02"
         browser.getControl(name="field.add_username").value = "username"
         browser.getControl(name="field.add_password").value = "password"
-        browser.getControl(
-            name="field.add_confirm_password"
-        ).value = "password"
+        browser.getControl(name="field.add_confirm_password").value = (
+            "password"
+        )
         browser.getControl("Save").click()
         with person_logged_in(self.person):
             rules = list(
@@ -2700,14 +2700,15 @@ class TestOCIRecipeEditPushRulesView(
         browser = self.getViewBrowser(self.recipe, user=self.person)
         browser.getLink("Edit push rules").click()
         browser.getControl(name="field.add_credentials").value = "existing"
-        browser.getControl(
-            name="field.add_image_name"
-        ).value = existing_image_name
-        browser.getControl(
-            name="field.existing_credentials"
-        ).value = "%s %s" % (
-            quote(existing_registry_url),
-            quote(existing_username),
+        browser.getControl(name="field.add_image_name").value = (
+            existing_image_name
+        )
+        browser.getControl(name="field.existing_credentials").value = (
+            "%s %s"
+            % (
+                quote(existing_registry_url),
+                quote(existing_username),
+            )
         )
         browser.getControl("Save").click()
         self.assertIn(
@@ -2826,9 +2827,9 @@ class TestOCIRecipeEditPushRulesView(
 
         # set image name to valid string
         with person_logged_in(self.person):
-            browser.getControl(
-                name="field.image_name.%d" % rule.id
-            ).value = "image1"
+            browser.getControl(name="field.image_name.%d" % rule.id).value = (
+                "image1"
+            )
         browser.getControl("Save").click()
 
         # and assert model changed
@@ -2867,9 +2868,9 @@ class TestOCIRecipeEditPushRulesView(
         browser.getControl(name="field.add_region").value = "new_region1"
         browser.getControl(name="field.add_username").value = "new_username"
         browser.getControl(name="field.add_password").value = "password"
-        browser.getControl(
-            name="field.add_confirm_password"
-        ).value = "password"
+        browser.getControl(name="field.add_confirm_password").value = (
+            "password"
+        )
 
         browser.getControl("Save").click()
         with person_logged_in(self.person):
diff --git a/lib/lp/oci/model/ocirecipebuildbehaviour.py b/lib/lp/oci/model/ocirecipebuildbehaviour.py
index 4ce649a..dd12112 100644
--- a/lib/lp/oci/model/ocirecipebuildbehaviour.py
+++ b/lib/lp/oci/model/ocirecipebuildbehaviour.py
@@ -117,9 +117,9 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase):
         }
         if build_request:
             info["build_request_id"] = build_request.id
-            info[
-                "build_request_timestamp"
-            ] = build_request.date_requested.isoformat()
+            info["build_request_timestamp"] = (
+                build_request.date_requested.isoformat()
+            )
         info["architectures"] = [
             i.distro_arch_series.architecturetag for i in builds
         ]
@@ -175,9 +175,9 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase):
                 )
                 args["git_repository"] = url
             else:
-                args[
-                    "git_repository"
-                ] = build.recipe.git_repository.git_https_url
+                args["git_repository"] = (
+                    build.recipe.git_repository.git_https_url
+                )
         else:
             raise CannotBuild(
                 "Source repository for ~%s/%s has been deleted."
diff --git a/lib/lp/registry/browser/person.py b/lib/lp/registry/browser/person.py
index de0003d..7a51447 100644
--- a/lib/lp/registry/browser/person.py
+++ b/lib/lp/registry/browser/person.py
@@ -3872,9 +3872,9 @@ class PersonRelatedSoftwareView(LaunchpadView):
                 BuildStatus.MANUALDEPWAIT,
                 BuildStatus.CHROOTWAIT,
             ]
-            needs_build_by_package[
-                build.source_package_release.id
-            ] = needs_build
+            needs_build_by_package[build.source_package_release.id] = (
+                needs_build
+            )
 
         return (builds_by_package, needs_build_by_package)
 
diff --git a/lib/lp/registry/browser/pillar.py b/lib/lp/registry/browser/pillar.py
index 22fec1a..830253d 100644
--- a/lib/lp/registry/browser/pillar.py
+++ b/lib/lp/registry/browser/pillar.py
@@ -295,9 +295,9 @@ class PillarViewMixin:
             SimpleVocabulary.fromItems(policy_items),
             value_fn=lambda item: item.name,
         )
-        cache.objects[
-            "team_membership_policy_data"
-        ] = team_membership_policy_data
+        cache.objects["team_membership_policy_data"] = (
+            team_membership_policy_data
+        )
 
 
 class PillarSharingView(LaunchpadView):
@@ -385,9 +385,9 @@ class PillarSharingView(LaunchpadView):
         cache.objects["sharing_permissions"] = self.sharing_permissions
         cache.objects["bug_sharing_policies"] = self.bug_sharing_policies
         cache.objects["branch_sharing_policies"] = self.branch_sharing_policies
-        cache.objects[
-            "specification_sharing_policies"
-        ] = self.specification_sharing_policies
+        cache.objects["specification_sharing_policies"] = (
+            self.specification_sharing_policies
+        )
         cache.objects["has_edit_permission"] = check_permission(
             "launchpad.Edit", self.context
         )
@@ -402,9 +402,9 @@ class PillarSharingView(LaunchpadView):
             "launchpad.LimitedView",
             [grantee for grantee, _, _ in batch_navigator.batch],
         )
-        cache.objects[
-            "grantee_data"
-        ] = self._getSharingService().jsonGranteeData(batch_navigator.batch)
+        cache.objects["grantee_data"] = (
+            self._getSharingService().jsonGranteeData(batch_navigator.batch)
+        )
         cache.objects.update(
             get_batch_properties_for_json_cache(self, batch_navigator)
         )
diff --git a/lib/lp/registry/browser/product.py b/lib/lp/registry/browser/product.py
index 3a5008a..400192d 100644
--- a/lib/lp/registry/browser/product.py
+++ b/lib/lp/registry/browser/product.py
@@ -2228,9 +2228,9 @@ class ProductSetBranchView(
             rcs_type = data.get("rcs_type")
 
             # Set the valid schemes based on rcs_type.
-            self.widgets[
-                "repo_url"
-            ].field.allowed_schemes = self._validSchemes(rcs_type)
+            self.widgets["repo_url"].field.allowed_schemes = (
+                self._validSchemes(rcs_type)
+            )
             # The branch location is not required for validation.
             self._setRequired(["branch_location"], False)
             # The cvs_module is required if it is a CVS import.
@@ -2759,9 +2759,9 @@ class ProjectAddStepTwo(StepView, ProductLicenseMixin, ReturnToReferrerMixin):
         self.widgets["name"].read_only = True
         # The "hint" is really more of an explanation at this point, but the
         # phrasing is different.
-        self.widgets[
-            "name"
-        ].hint = "When published, this will be the project's URL."
+        self.widgets["name"].hint = (
+            "When published, this will be the project's URL."
+        )
         self.widgets["display_name"].visible = False
         self.widgets["source_package_name"].visible = False
         self.widgets["distroseries"].visible = False
diff --git a/lib/lp/registry/browser/tests/test_distribution_views.py b/lib/lp/registry/browser/tests/test_distribution_views.py
index 178f5dd..9867d95 100644
--- a/lib/lp/registry/browser/tests/test_distribution_views.py
+++ b/lib/lp/registry/browser/tests/test_distribution_views.py
@@ -604,9 +604,9 @@ class TestDistroEditView(OCIConfigHelperMixin, TestCaseWithFactory):
         transaction.commit()
         password = self.factory.getUniqueUnicode()
         edit_form["field.oci_registry_credentials.url"] = url
-        edit_form[
-            "field.oci_registry_credentials.username"
-        ] = credentials.username
+        edit_form["field.oci_registry_credentials.username"] = (
+            credentials.username
+        )
         edit_form["field.oci_registry_credentials.region"] = ""
         edit_form["field.oci_registry_credentials.password"] = password
         edit_form["field.oci_registry_credentials.confirm_password"] = password
diff --git a/lib/lp/registry/browser/tests/test_distroseries.py b/lib/lp/registry/browser/tests/test_distroseries.py
index 2298c5c..30b4642 100644
--- a/lib/lp/registry/browser/tests/test_distroseries.py
+++ b/lib/lp/registry/browser/tests/test_distroseries.py
@@ -1401,12 +1401,12 @@ class TestDistroSeriesLocalDifferences(
         )
 
         # Delete the publications.
-        removeSecurityProxy(
-            difference.source_pub
-        ).status = PackagePublishingStatus.DELETED
-        removeSecurityProxy(
-            difference.parent_source_pub
-        ).status = PackagePublishingStatus.DELETED
+        removeSecurityProxy(difference.source_pub).status = (
+            PackagePublishingStatus.DELETED
+        )
+        removeSecurityProxy(difference.parent_source_pub).status = (
+            PackagePublishingStatus.DELETED
+        )
         # Flush out the changes and invalidate caches (esp. property caches).
         flush_database_caches()
 
diff --git a/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py b/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py
index f165611..d7c979c 100644
--- a/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py
+++ b/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py
@@ -159,9 +159,9 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory):
                 DistroSeriesDifferenceType.MISSING_FROM_DERIVED_SERIES
             )
         )
-        removeSecurityProxy(
-            ds_diff
-        ).parent_source_pub.status = PackagePublishingStatus.DELETED
+        removeSecurityProxy(ds_diff).parent_source_pub.status = (
+            PackagePublishingStatus.DELETED
+        )
         ds_diff.update()
 
         view = create_initialized_view(ds_diff, "+listing-distroseries-extra")
diff --git a/lib/lp/registry/browser/tests/test_person.py b/lib/lp/registry/browser/tests/test_person.py
index 19425f4..47a580c 100644
--- a/lib/lp/registry/browser/tests/test_person.py
+++ b/lib/lp/registry/browser/tests/test_person.py
@@ -1874,9 +1874,9 @@ class TestPersonOCIRegistryCredentialsView(
         browser.getControl(name="field.add_owner").value = [new_owner_name]
         browser.getControl(name="field.add_username").value = "new_username"
         browser.getControl(name="field.add_password").value = "password"
-        browser.getControl(
-            name="field.add_confirm_password"
-        ).value = "password"
+        browser.getControl(name="field.add_confirm_password").value = (
+            "password"
+        )
         browser.getControl("Save").click()
 
         with person_logged_in(self.user):
diff --git a/lib/lp/registry/browser/tests/test_poll.py b/lib/lp/registry/browser/tests/test_poll.py
index 773dec5..fb1ed86 100644
--- a/lib/lp/registry/browser/tests/test_poll.py
+++ b/lib/lp/registry/browser/tests/test_poll.py
@@ -68,12 +68,12 @@ class TestPollAddView(BrowserTestCase):
         )
         browser.getControl("The unique name of this poll").value = "colour"
         browser.getControl("The title of this poll").value = "Favourite Colour"
-        browser.getControl(
-            "The date and time when this poll opens"
-        ).value = str(now + timedelta(days=1))
-        browser.getControl(
-            "The date and time when this poll closes"
-        ).value = str(now + timedelta(days=2))
+        browser.getControl("The date and time when this poll opens").value = (
+            str(now + timedelta(days=1))
+        )
+        browser.getControl("The date and time when this poll closes").value = (
+            str(now + timedelta(days=2))
+        )
         browser.getControl(
             "The proposition that is going to be voted"
         ).value = "What is your favourite colour?"
@@ -89,12 +89,12 @@ class TestPollAddView(BrowserTestCase):
         browser = self.getViewBrowser(team, view_name="+newpoll", user=person)
         browser.getControl("The unique name of this poll").value = "colour"
         browser.getControl("The title of this poll").value = "Favourite Colour"
-        browser.getControl(
-            "The date and time when this poll opens"
-        ).value = str(now + timedelta(days=1))
-        browser.getControl(
-            "The date and time when this poll closes"
-        ).value = str(now + timedelta(days=2))
+        browser.getControl("The date and time when this poll opens").value = (
+            str(now + timedelta(days=1))
+        )
+        browser.getControl("The date and time when this poll closes").value = (
+            str(now + timedelta(days=2))
+        )
         browser.getControl(
             "The proposition that is going to be voted"
         ).value = "What is your favourite colour?"
diff --git a/lib/lp/registry/browser/tests/test_product.py b/lib/lp/registry/browser/tests/test_product.py
index 3d1775f..4c6fc92 100644
--- a/lib/lp/registry/browser/tests/test_product.py
+++ b/lib/lp/registry/browser/tests/test_product.py
@@ -1442,9 +1442,9 @@ class TestBrowserProductSetBranchView(BrowserTestCase):
         self.assertEqual(
             project_name, browser.getControl("Git repository name").value
         )
-        browser.getControl(
-            "Git repository URL"
-        ).value = "https://git.example.org/imported";
+        browser.getControl("Git repository URL").value = (
+            "https://git.example.org/imported";
+        )
         browser.getControl("Update").click()
 
         tag = Tag(
@@ -1471,9 +1471,9 @@ class TestBrowserProductSetBranchView(BrowserTestCase):
         browser.getControl(
             "Import a Git repository hosted somewhere else"
         ).click()
-        browser.getControl(
-            "Git repository URL"
-        ).value = "svn://svn.example.org/imported"
+        browser.getControl("Git repository URL").value = (
+            "svn://svn.example.org/imported"
+        )
         browser.getControl("Update").click()
 
         tag = Tag(
diff --git a/lib/lp/registry/browser/tests/test_productseries_views.py b/lib/lp/registry/browser/tests/test_productseries_views.py
index b74fd49..f43eb49 100644
--- a/lib/lp/registry/browser/tests/test_productseries_views.py
+++ b/lib/lp/registry/browser/tests/test_productseries_views.py
@@ -195,9 +195,9 @@ class TestWithBrowser(BrowserTestCase):
             distroseries=ubuntu_series, publish=True
         )
         browser = self.getBrowser(productseries, "+ubuntupkg")
-        browser.getControl(
-            "Source Package Name"
-        ).value = sp.sourcepackagename.name
+        browser.getControl("Source Package Name").value = (
+            sp.sourcepackagename.name
+        )
         browser.getControl(ubuntu_series.displayname).selected = True
         browser.getControl("Update").click()
         tag = soupmatchers.Tag(
diff --git a/lib/lp/registry/browser/tests/test_sourcepackage_views.py b/lib/lp/registry/browser/tests/test_sourcepackage_views.py
index 9e60016..e171884 100644
--- a/lib/lp/registry/browser/tests/test_sourcepackage_views.py
+++ b/lib/lp/registry/browser/tests/test_sourcepackage_views.py
@@ -159,9 +159,9 @@ class TestSourcePackageViewHelpers(TestCaseWithFactory):
     def test_get_register_upstream_url_homepage(self):
         source_package = self._makePublishedSourcePackage()
         # SourcePackageReleases cannot be modified by users.
-        removeSecurityProxy(
-            source_package.currentrelease
-        ).homepage = "http://eg.dom/bonkers";
+        removeSecurityProxy(source_package.currentrelease).homepage = (
+            "http://eg.dom/bonkers";
+        )
         url = get_register_upstream_url(source_package)
         self.assertInQueryString(
             url, "field.homepageurl", "http://eg.dom/bonkers";
diff --git a/lib/lp/registry/doc/productseries.rst b/lib/lp/registry/doc/productseries.rst
index 5f931ff..7c55335 100644
--- a/lib/lp/registry/doc/productseries.rst
+++ b/lib/lp/registry/doc/productseries.rst
@@ -233,9 +233,9 @@ Now, we will make one of them accepted, the other declined, and both of
 them informational.
 
     >>> from lp.blueprints.enums import SpecificationImplementationStatus
-    >>> a.definition_status = (
-    ...     b.definition_status
-    ... ) = SpecificationDefinitionStatus.APPROVED
+    >>> a.definition_status = b.definition_status = (
+    ...     SpecificationDefinitionStatus.APPROVED
+    ... )
     >>> a.implementation_status = (
     ...     SpecificationImplementationStatus.INFORMATIONAL
     ... )
diff --git a/lib/lp/registry/doc/teammembership.rst b/lib/lp/registry/doc/teammembership.rst
index 173cd53..2865825 100644
--- a/lib/lp/registry/doc/teammembership.rst
+++ b/lib/lp/registry/doc/teammembership.rst
@@ -696,9 +696,9 @@ deactivated, so it should not be flagged as expired.
     True
     >>> sp_on_ubuntu_translators.status.title
     'Deactivated'
-    >>> removeSecurityProxy(
-    ...     sp_on_ubuntu_translators
-    ... ).dateexpires = one_day_ago
+    >>> removeSecurityProxy(sp_on_ubuntu_translators).dateexpires = (
+    ...     one_day_ago
+    ... )
     >>> flush_database_updates()
 
     >>> for membership in membershipset.getMembershipsToExpire():
diff --git a/lib/lp/registry/mail/teammembership.py b/lib/lp/registry/mail/teammembership.py
index b305930..46749ee 100644
--- a/lib/lp/registry/mail/teammembership.py
+++ b/lib/lp/registry/mail/teammembership.py
@@ -147,14 +147,14 @@ class TeamMembershipMailer(BaseMailer):
                 template_name = "new-member-notification.txt"
                 subject = "You have been added to %s" % team.name
             for recipient in get_recipients(member):
-                recipients[
-                    recipient
-                ] = TeamMembershipRecipientReason.forNewMember(
-                    member,
-                    team,
-                    recipient,
-                    subject=subject,
-                    template_name=template_name,
+                recipients[recipient] = (
+                    TeamMembershipRecipientReason.forNewMember(
+                        member,
+                        team,
+                        recipient,
+                        subject=subject,
+                        template_name=template_name,
+                    )
                 )
         # Open teams do not notify admins about new members.
         if team.membership_policy != TeamMembershipPolicy.OPEN:
@@ -286,10 +286,13 @@ class TeamMembershipMailer(BaseMailer):
                     recipient_class = "bulk"
                 else:
                     recipient_class = "personal"
-                recipients[
-                    recipient
-                ] = TeamMembershipRecipientReason.forMember(
-                    member, team, recipient, recipient_class=recipient_class
+                recipients[recipient] = (
+                    TeamMembershipRecipientReason.forMember(
+                        member,
+                        team,
+                        recipient,
+                        recipient_class=recipient_class,
+                    )
                 )
         # Don't send admin notifications for open teams: they're
         # unrestricted, so notifications on join/leave do not help the
@@ -300,10 +303,10 @@ class TeamMembershipMailer(BaseMailer):
                     # The new member may also be a team admin; don't send
                     # two notifications in that case.
                     if recipient not in recipients:
-                        recipients[
-                            recipient
-                        ] = TeamMembershipRecipientReason.forAdmin(
-                            admin, team, recipient, recipient_class="bulk"
+                        recipients[recipient] = (
+                            TeamMembershipRecipientReason.forAdmin(
+                                admin, team, recipient, recipient_class="bulk"
+                            )
                         )
 
         extra_params = {
diff --git a/lib/lp/registry/model/distribution.py b/lib/lp/registry/model/distribution.py
index 924c672..62ee160 100644
--- a/lib/lp/registry/model/distribution.py
+++ b/lib/lp/registry/model/distribution.py
@@ -2441,9 +2441,9 @@ class DistributionSet:
         result = {}
         for spr, distro_id in releases:
             distro = getUtility(IDistributionSet).get(distro_id)
-            result[
-                distro.getSourcePackage(spr.sourcepackagename)
-            ] = DistributionSourcePackageRelease(distro, spr)
+            result[distro.getSourcePackage(spr.sourcepackagename)] = (
+                DistributionSourcePackageRelease(distro, spr)
+            )
         return result
 
     def getDerivedDistributions(self):
diff --git a/lib/lp/registry/model/distroseries.py b/lib/lp/registry/model/distroseries.py
index f67348b..78283b9 100644
--- a/lib/lp/registry/model/distroseries.py
+++ b/lib/lp/registry/model/distroseries.py
@@ -966,9 +966,9 @@ class DistroSeries(
     @strict_supported_component_dependencies.setter
     def strict_supported_component_dependencies(self, value):
         assert isinstance(value, bool)
-        self.publishing_options[
-            "strict_supported_component_dependencies"
-        ] = value
+        self.publishing_options["strict_supported_component_dependencies"] = (
+            value
+        )
 
     @property
     def publish_i18n_index(self):
@@ -1872,9 +1872,9 @@ class DistroSeriesSet:
         result = {}
         for spr, series_id in releases:
             series = getUtility(IDistroSeriesSet).get(series_id)
-            result[
-                series.getSourcePackage(spr.sourcepackagename)
-            ] = DistributionSourcePackageRelease(series.distribution, spr)
+            result[series.getSourcePackage(spr.sourcepackagename)] = (
+                DistributionSourcePackageRelease(series.distribution, spr)
+            )
         return result
 
     def search(self, distribution=None, isreleased=None, orderBy=None):
diff --git a/lib/lp/registry/model/mailinglist.py b/lib/lp/registry/model/mailinglist.py
index f3fcaf5..470d124 100644
--- a/lib/lp/registry/model/mailinglist.py
+++ b/lib/lp/registry/model/mailinglist.py
@@ -328,9 +328,9 @@ class MailingList(StormBase):
                 # We also need to remove the email's security proxy because
                 # this method will be called via the internal XMLRPC rather
                 # than as a response to a user action.
-                removeSecurityProxy(
-                    email
-                ).status = EmailAddressStatus.VALIDATED
+                removeSecurityProxy(email).status = (
+                    EmailAddressStatus.VALIDATED
+                )
             assert (
                 email.person == self.team
             ), "Email already associated with another team."
diff --git a/lib/lp/registry/stories/announcements/xx-announcements.rst b/lib/lp/registry/stories/announcements/xx-announcements.rst
index a051a28..a6ff3c5 100644
--- a/lib/lp/registry/stories/announcements/xx-announcements.rst
+++ b/lib/lp/registry/stories/announcements/xx-announcements.rst
@@ -205,15 +205,15 @@ announcement:
 
     >>> priv_browser.open("http://launchpad.test/apache";)
     >>> priv_browser.getLink("Make announcement").click()
-    >>> priv_browser.getControl(
-    ...     "Headline"
-    ... ).value = "Apache announcement headline"
-    >>> priv_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Apache announcement summary"
-    >>> priv_browser.getControl(
-    ...     "URL"
-    ... ).value = "http://apache.org/announcement/rocking/";
+    >>> priv_browser.getControl("Headline").value = (
+    ...     "Apache announcement headline"
+    ... )
+    >>> priv_browser.getControl("Summary").value = (
+    ...     "Apache announcement summary"
+    ... )
+    >>> priv_browser.getControl("URL").value = (
+    ...     "http://apache.org/announcement/rocking/";
+    ... )
     >>> priv_browser.getControl("Make announcement").click()
 
 Making the announcement takes the user back to the main page for the
@@ -245,12 +245,12 @@ Add another one, this time specifying a date in the past, which should
 work too:
 
     >>> priv_browser.getLink("Make announcement").click()
-    >>> priv_browser.getControl(
-    ...     "Headline"
-    ... ).value = "Tomcat announcement headline"
-    >>> priv_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Tomcat announcement summary"
+    >>> priv_browser.getControl("Headline").value = (
+    ...     "Tomcat announcement headline"
+    ... )
+    >>> priv_browser.getControl("Summary").value = (
+    ...     "Tomcat announcement summary"
+    ... )
     >>> priv_browser.getControl("specific date and time").click()
     >>> priv_browser.getControl(
     ...     name="field.publication_date.announcement_date"
@@ -281,12 +281,12 @@ announcement immediately:
     >>> "Derby announcement" in latest_news(priv_browser.contents)
     False
     >>> priv_browser.getLink("Make announcement").click()
-    >>> priv_browser.getControl(
-    ...     "Headline"
-    ... ).value = "Derby announcement headline"
-    >>> priv_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Derby announcement summary"
+    >>> priv_browser.getControl("Headline").value = (
+    ...     "Derby announcement headline"
+    ... )
+    >>> priv_browser.getControl("Summary").value = (
+    ...     "Derby announcement summary"
+    ... )
     >>> priv_browser.getControl("Make announcement").click()
     >>> print(priv_browser.title)
     Derby in Launchpad
@@ -299,12 +299,12 @@ date in the future when the announcement will be made:
 
     >>> priv_browser.open("http://launchpad.test/jokosher";)
     >>> priv_browser.getLink("Make announcement").click()
-    >>> priv_browser.getControl(
-    ...     "Headline"
-    ... ).value = "Jokosher announcement headline"
-    >>> priv_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Jokosher announcement summary"
+    >>> priv_browser.getControl("Headline").value = (
+    ...     "Jokosher announcement headline"
+    ... )
+    >>> priv_browser.getControl("Summary").value = (
+    ...     "Jokosher announcement summary"
+    ... )
     >>> priv_browser.getControl("specific date and time").click()
     >>> priv_browser.getControl(
     ...     name="field.publication_date.announcement_date"
@@ -320,12 +320,12 @@ a date for the announcement at all:
 
     >>> priv_browser.open("http://launchpad.test/kubuntu";)
     >>> priv_browser.getLink("Make announcement").click()
-    >>> priv_browser.getControl(
-    ...     "Headline"
-    ... ).value = "Kubuntu announcement headline"
-    >>> priv_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Kubuntu announcement summary"
+    >>> priv_browser.getControl("Headline").value = (
+    ...     "Kubuntu announcement headline"
+    ... )
+    >>> priv_browser.getControl("Summary").value = (
+    ...     "Kubuntu announcement summary"
+    ... )
     >>> priv_browser.getControl("some time in the future").click()
     >>> priv_browser.getControl("Make announcement").click()
     >>> print(priv_browser.title)
@@ -337,12 +337,12 @@ And finally for RedHat, an IDistribution, with immediate announcement:
 
     >>> priv_browser.open("http://launchpad.test/redhat";)
     >>> priv_browser.getLink("Make announcement").click()
-    >>> priv_browser.getControl(
-    ...     "Headline"
-    ... ).value = "RedHat announcement headline"
-    >>> priv_browser.getControl(
-    ...     "Summary"
-    ... ).value = "RedHat announcement summary"
+    >>> priv_browser.getControl("Headline").value = (
+    ...     "RedHat announcement headline"
+    ... )
+    >>> priv_browser.getControl("Summary").value = (
+    ...     "RedHat announcement summary"
+    ... )
     >>> priv_browser.getControl("Make announcement").click()
     >>> print(priv_browser.title)
     Red Hat in Launchpad
diff --git a/lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.rst b/lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.rst
index f82a22c..027ed82 100644
--- a/lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.rst
+++ b/lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.rst
@@ -85,9 +85,9 @@ Just like Launchpad administrators can.
     >>> print(admin_browser.getControl(name="field.answers_usage").value[0])
     LAUNCHPAD
 
-    >>> admin_browser.getControl(
-    ...     name="field.enable_bug_expiration"
-    ... ).value = False
+    >>> admin_browser.getControl(name="field.enable_bug_expiration").value = (
+    ...     False
+    ... )
     >>> admin_browser.getControl(name="field.official_malone").value = False
     >>> admin_browser.getControl(name="field.blueprints_usage").value = [
     ...     "UNKNOWN"
@@ -106,15 +106,15 @@ Only administrators can configure the publisher for the distribution:
     >>> print(admin_browser.title)
     Publisher configuration for...
 
-    >>> admin_browser.getControl(
-    ...     name="field.root_dir"
-    ... ).value = "/tmp/root_dir"
-    >>> admin_browser.getControl(
-    ...     name="field.base_url"
-    ... ).value = "http://base.url/";
-    >>> admin_browser.getControl(
-    ...     name="field.copy_base_url"
-    ... ).value = "http://copy.base.url/";
+    >>> admin_browser.getControl(name="field.root_dir").value = (
+    ...     "/tmp/root_dir"
+    ... )
+    >>> admin_browser.getControl(name="field.base_url").value = (
+    ...     "http://base.url/";
+    ... )
+    >>> admin_browser.getControl(name="field.copy_base_url").value = (
+    ...     "http://copy.base.url/";
+    ... )
     >>> admin_browser.getControl("Save").click()
 
     >>> print(admin_browser.url)
@@ -134,9 +134,9 @@ Foo Bar updates Ubuntu to use Launchpad to track bugs, and enables
 bug expiration.
 
     >>> admin_browser.getLink("Change details").click()
-    >>> admin_browser.getControl(
-    ...     name="field.enable_bug_expiration"
-    ... ).value = True
+    >>> admin_browser.getControl(name="field.enable_bug_expiration").value = (
+    ...     True
+    ... )
     >>> admin_browser.getControl(name="field.official_malone").value = True
     >>> admin_browser.getControl("Change", index=3).click()
 
diff --git a/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.rst b/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.rst
index ce0af36..9691809 100644
--- a/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.rst
+++ b/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.rst
@@ -141,12 +141,12 @@ pending mirrors have never been probed.
 Register an unreviewed archive mirror.
 
     >>> browser.open("http://launchpad.test/ubuntu/+newmirror";)
-    >>> browser.getControl(
-    ...     name="field.display_name"
-    ... ).value = "Kabul LUG mirror"
-    >>> browser.getControl(
-    ...     name="field.ftp_base_url"
-    ... ).value = "ftp://kabullug.org/ubuntu";
+    >>> browser.getControl(name="field.display_name").value = (
+    ...     "Kabul LUG mirror"
+    ... )
+    >>> browser.getControl(name="field.ftp_base_url").value = (
+    ...     "ftp://kabullug.org/ubuntu";
+    ... )
     >>> browser.getControl(name="field.country").value = ["1"]  # Afghanistan
     >>> browser.getControl(name="field.speed").value = ["S10G"]
     >>> browser.getControl(name="field.content").value = ["ARCHIVE"]
diff --git a/lib/lp/registry/stories/gpg-coc/xx-gpg-coc.rst b/lib/lp/registry/stories/gpg-coc/xx-gpg-coc.rst
index d6f3073..35248d4 100644
--- a/lib/lp/registry/stories/gpg-coc/xx-gpg-coc.rst
+++ b/lib/lp/registry/stories/gpg-coc/xx-gpg-coc.rst
@@ -637,9 +637,9 @@ Perform Acknowledge process as Foo bar person:
     >>> admin_browser.title
     'Register a code of conduct signature'
 
-    >>> admin_browser.getControl(
-    ...     name="field.owner"
-    ... ).value = "mark@xxxxxxxxxxx"
+    >>> admin_browser.getControl(name="field.owner").value = (
+    ...     "mark@xxxxxxxxxxx"
+    ... )
     >>> admin_browser.getControl("Register").click()
     >>> admin_browser.url
     'http://localhost:9000/codeofconduct/console'
diff --git a/lib/lp/registry/stories/mailinglists/hosted-email-address.rst b/lib/lp/registry/stories/mailinglists/hosted-email-address.rst
index 349ca87..428067c 100644
--- a/lib/lp/registry/stories/mailinglists/hosted-email-address.rst
+++ b/lib/lp/registry/stories/mailinglists/hosted-email-address.rst
@@ -37,9 +37,9 @@ Launchpad sends that address a confirmation message.
     >>> from lp.services.mail import stub
     >>> stub.test_emails = []
     >>> user_browser.getControl("Another email address").selected = True
-    >>> user_browser.getControl(
-    ...     name="field.contact_address"
-    ... ).value = "bar@xxxxxxxxxxx"
+    >>> user_browser.getControl(name="field.contact_address").value = (
+    ...     "bar@xxxxxxxxxxx"
+    ... )
     >>> user_browser.getControl("Change").click()
     >>> print(user_browser.title)
     Aardvarks in Launchpad
diff --git a/lib/lp/registry/stories/mailinglists/welcome-message.rst b/lib/lp/registry/stories/mailinglists/welcome-message.rst
index f0d35a2..f49663c 100644
--- a/lib/lp/registry/stories/mailinglists/welcome-message.rst
+++ b/lib/lp/registry/stories/mailinglists/welcome-message.rst
@@ -49,9 +49,9 @@ What if Mailman failed to apply the change?
     >>> from lp.registry.interfaces.mailinglist import MailingListStatus
     >>> from zope.security.proxy import removeSecurityProxy
     >>> naked_list = removeSecurityProxy(mailing_list)
-    >>> removeSecurityProxy(
-    ...     mailing_list
-    ... ).status = MailingListStatus.MOD_FAILED
+    >>> removeSecurityProxy(mailing_list).status = (
+    ...     MailingListStatus.MOD_FAILED
+    ... )
     >>> transaction.commit()
     >>> logout()
 
diff --git a/lib/lp/registry/stories/milestone/xx-milestone-description.rst b/lib/lp/registry/stories/milestone/xx-milestone-description.rst
index b6a5ec2..28491a5 100644
--- a/lib/lp/registry/stories/milestone/xx-milestone-description.rst
+++ b/lib/lp/registry/stories/milestone/xx-milestone-description.rst
@@ -22,9 +22,9 @@ We can set the summary while creating a milestone for a Distribution.
 
     >>> test_browser.open("http://launchpad.test/ubuntu/hoary/+addmilestone";)
     >>> test_browser.getControl("Name").value = "milestone1"
-    >>> test_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Summary of first Ubuntu milestone."
+    >>> test_browser.getControl("Summary").value = (
+    ...     "Summary of first Ubuntu milestone."
+    ... )
     >>> test_browser.getControl("Register Milestone").click()
 
 The summary appears on the milestone index page.
@@ -41,9 +41,9 @@ We can edit the summary after creating the milestone.
     >>> test_browser.open(
     ...     "http://launchpad.test/ubuntu/+milestone/milestone1/+edit";
     ... )
-    >>> test_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Modified summary of first Ubuntu milestone."
+    >>> test_browser.getControl("Summary").value = (
+    ...     "Modified summary of first Ubuntu milestone."
+    ... )
     >>> test_browser.getControl("Update").click()
 
 And see that it is indeed modified on the milestone page.
@@ -65,9 +65,9 @@ We can set the summary while creating a milestone for a Product.
     ...     "http://launchpad.test/alsa-utils/trunk/+addmilestone";
     ... )
     >>> test_browser.getControl("Name").value = "milestone1"
-    >>> test_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Summary of first alsa-utils milestone."
+    >>> test_browser.getControl("Summary").value = (
+    ...     "Summary of first alsa-utils milestone."
+    ... )
     >>> test_browser.getControl("Register Milestone").click()
 
 The summary appears on the milestone index page.
@@ -84,9 +84,9 @@ We can edit the summary after creating the milestone.
     >>> test_browser.open(
     ...     "http://launchpad.test/alsa-utils/+milestone/milestone1/+edit";
     ... )
-    >>> test_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Modified summary of first alsa-utils milestone."
+    >>> test_browser.getControl("Summary").value = (
+    ...     "Modified summary of first alsa-utils milestone."
+    ... )
     >>> test_browser.getControl("Update").click()
 
 And see that it is indeed modified on the milestone page.
diff --git a/lib/lp/registry/stories/person/xx-admin-person-review.rst b/lib/lp/registry/stories/person/xx-admin-person-review.rst
index 508c5a9..5accfc7 100644
--- a/lib/lp/registry/stories/person/xx-admin-person-review.rst
+++ b/lib/lp/registry/stories/person/xx-admin-person-review.rst
@@ -28,9 +28,9 @@ Registry admins can review users and update some of their information.
 Registry experts can't change the displayname.
 
     >>> expert_browser.getLink("Administer").click()
-    >>> expert_browser.getControl(
-    ...     "Display Name", index=0
-    ... ).value = "The one and only Salgado"
+    >>> expert_browser.getControl("Display Name", index=0).value = (
+    ...     "The one and only Salgado"
+    ... )
     >>> expert_browser.getControl("Change").click()
     Traceback (most recent call last):
     ...
@@ -39,9 +39,9 @@ Registry experts can't change the displayname.
 But Launchpad admins can.
     >>> admin_browser.open("http://launchpad.test/~no-way/+review";)
     >>> admin_browser.getControl("Name", index=0).value = "salgado"
-    >>> admin_browser.getControl(
-    ...     "Display Name", index=0
-    ... ).value = "The one and only Salgado"
+    >>> admin_browser.getControl("Display Name", index=0).value = (
+    ...     "The one and only Salgado"
+    ... )
     >>> admin_browser.getControl("Change").click()
     >>> print(admin_browser.title)
     The one and only Salgado in Launchpad
diff --git a/lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst b/lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst
index f58b5bf..fb66cf4 100644
--- a/lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst
+++ b/lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst
@@ -19,9 +19,9 @@ profile page and uses the 'Update Jabber IDs' link.
 The user enters the Jabber ID in the text field and clicks on the
 'Save Changes' button.
 
-    >>> user_browser.getControl(
-    ...     name="field.jabberid"
-    ... ).value = "jeff@xxxxxxxxxx"
+    >>> user_browser.getControl(name="field.jabberid").value = (
+    ...     "jeff@xxxxxxxxxx"
+    ... )
     >>> user_browser.getControl("Save Changes").click()
 
 In this case, the user tried registering a jabber ID that was already
@@ -40,9 +40,9 @@ an error is displayed and the user can enter another one:
 However, if the user enters a Jabber ID which isn't already registered,
 it will be associated with their account.
 
-    >>> user_browser.getControl(
-    ...     name="field.jabberid"
-    ... ).value = "no-priv@xxxxxxxxxx"
+    >>> user_browser.getControl(name="field.jabberid").value = (
+    ...     "no-priv@xxxxxxxxxx"
+    ... )
     >>> user_browser.getControl("Save Changes").click()
     >>> show_errors(user_browser)
 
diff --git a/lib/lp/registry/stories/person/xx-person-editgpgkeys-invalid-key.rst b/lib/lp/registry/stories/person/xx-person-editgpgkeys-invalid-key.rst
index 6754987..81ac6d6 100644
--- a/lib/lp/registry/stories/person/xx-person-editgpgkeys-invalid-key.rst
+++ b/lib/lp/registry/stories/person/xx-person-editgpgkeys-invalid-key.rst
@@ -35,9 +35,9 @@ Attempts to claim a revoked OpenPGP key fail:
     >>> logout()
     >>> browser = setupBrowserFreshLogin(name12)
     >>> browser.open("http://launchpad.test/~name12/+editpgpkeys";)
-    >>> browser.getControl(
-    ...     name="fingerprint"
-    ... ).value = "84D205F03E1E67096CB54E262BE83793AACCD97C"
+    >>> browser.getControl(name="fingerprint").value = (
+    ...     "84D205F03E1E67096CB54E262BE83793AACCD97C"
+    ... )
     >>> browser.getControl("Import Key").click()
     >>> for tag in find_tags_by_class(browser.contents, "error message"):
     ...     print(tag.decode_contents())
@@ -52,9 +52,9 @@ Attempts to claim a revoked OpenPGP key fail:
 
 Attempts to claim an expired OpenPGP key also fail:
 
-    >>> browser.getControl(
-    ...     name="fingerprint"
-    ... ).value = "0DD64D28E5F41138533495200E3DB4D402F53CC6"
+    >>> browser.getControl(name="fingerprint").value = (
+    ...     "0DD64D28E5F41138533495200E3DB4D402F53CC6"
+    ... )
     >>> browser.getControl("Import Key").click()
     >>> for tag in find_tags_by_class(browser.contents, "error message"):
     ...     print(tag.decode_contents())
diff --git a/lib/lp/registry/stories/product/xx-product-add.rst b/lib/lp/registry/stories/product/xx-product-add.rst
index a183c4d..56aeede 100644
--- a/lib/lp/registry/stories/product/xx-product-add.rst
+++ b/lib/lp/registry/stories/product/xx-product-add.rst
@@ -65,9 +65,9 @@ Realizing their mistake, Sample Person fills out the project's basic
 information correctly this time.
 
     >>> user_browser.getControl("URL").value = "aardvark"
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "A project designed to placate ornery aardvarks"
+    >>> user_browser.getControl("Summary").value = (
+    ...     "A project designed to placate ornery aardvarks"
+    ... )
 
     >>> user_browser.getControl("Continue").click()
 
@@ -92,12 +92,12 @@ modify the project's URL.
 Sample Person is given the opportunity though to change the summary.
 They can also add a longer description.
 
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Control pesky aardvarkian fnords"
-    >>> user_browser.getControl(
-    ...     "Description"
-    ... ).value = "The desktop aardvark is an ornery thing."
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Control pesky aardvarkian fnords"
+    ... )
+    >>> user_browser.getControl("Description").value = (
+    ...     "The desktop aardvark is an ornery thing."
+    ... )
     >>> user_browser.getControl("Python Licence").click()
     >>> user_browser.getControl("Complete Registration").click()
     >>> print(user_browser.title)
@@ -140,9 +140,9 @@ interested in being the project maintainer for the long run.
 
     >>> user_browser.getControl("Name").value = "kittyhawk"
     >>> user_browser.getControl("URL").value = "kittyhawk"
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Kitty Hawk Air Traffic Simulator"
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Kitty Hawk Air Traffic Simulator"
+    ... )
     >>> user_browser.getControl("Continue").click()
     >>> user_browser.getControl("Python Licence").click()
     >>> disclaim = user_browser.getControl(name="field.disclaim_maintainer")
@@ -174,9 +174,9 @@ Firefox.
 
     >>> user_browser.getControl("Name").value = "Snowdog"
     >>> user_browser.getControl("URL").value = "snowdog"
-    >>> user_browser.getControl(
-    ...     "Summary"
-    ... ).value = "Snowdog is a browser similar to Firefox"
+    >>> user_browser.getControl("Summary").value = (
+    ...     "Snowdog is a browser similar to Firefox"
+    ... )
     >>> user_browser.getControl("Continue").click()
 
 A search is performed using the terms in the URL, title, and summary.  The
diff --git a/lib/lp/registry/stories/product/xx-product-code-trunk.rst b/lib/lp/registry/stories/product/xx-product-code-trunk.rst
index 13d4994..ffb49d3 100644
--- a/lib/lp/registry/stories/product/xx-product-code-trunk.rst
+++ b/lib/lp/registry/stories/product/xx-product-code-trunk.rst
@@ -100,9 +100,9 @@ The owner can specify the development focus branch from the overview page.
 
     >>> owner_browser.getLink(url="+configure-code").click()
     >>> owner_browser.getControl("Bazaar", index=0).click()
-    >>> owner_browser.getControl(
-    ...     name="field.branch_location"
-    ... ).value = "~eric/fooix/trunk"
+    >>> owner_browser.getControl(name="field.branch_location").value = (
+    ...     "~eric/fooix/trunk"
+    ... )
     >>> owner_browser.getControl("Update").click()
     >>> print_feedback_messages(owner_browser.contents)
     Project settings updated.
diff --git a/lib/lp/registry/stories/product/xx-product-edit.rst b/lib/lp/registry/stories/product/xx-product-edit.rst
index 5273185..aaaf64b 100644
--- a/lib/lp/registry/stories/product/xx-product-edit.rst
+++ b/lib/lp/registry/stories/product/xx-product-edit.rst
@@ -78,9 +78,9 @@ First a user adds a product named newproductname.
     >>> user_browser.getControl("Summary").value = "summary"
     >>> user_browser.getControl("Continue").click()
 
-    >>> user_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "description"
+    >>> user_browser.getControl(name="field.description").value = (
+    ...     "description"
+    ... )
     >>> user_browser.getControl(name="field.licenses").value = ["GNU_GPL_V2"]
     >>> user_browser.getControl(name="field.license_info").value = "foo"
     >>> user_browser.getControl("Complete Registration").click()
@@ -95,9 +95,9 @@ Then a product named newproductname2.
     >>> user_browser.getControl("Summary").value = "summary2"
     >>> user_browser.getControl("Continue").click()
 
-    >>> user_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "description2"
+    >>> user_browser.getControl(name="field.description").value = (
+    ...     "description2"
+    ... )
     >>> user_browser.getControl(name="field.licenses").value = ["GNU_GPL_V2"]
     >>> user_browser.getControl(name="field.license_info").value = "foo"
     >>> user_browser.getControl("Complete Registration").click()
diff --git a/lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.rst b/lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.rst
index 85201ed..afa7bf4 100644
--- a/lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.rst
+++ b/lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.rst
@@ -36,9 +36,9 @@ After checking that the page +addseries is there, we try to add a new series.
     >>> browser.getControl("Name").value = "stable"
     >>> browser.getControl("Summary").value = "Product series add testing"
     >>> browser.getControl("Branch").value = "~mark/firefox/release-0.9.2"
-    >>> browser.getControl(
-    ...     "Release URL pattern"
-    ... ).value = "ftp://ftp.mozilla.org/pub/mozilla/firefox-*.tar.gz";
+    >>> browser.getControl("Release URL pattern").value = (
+    ...     "ftp://ftp.mozilla.org/pub/mozilla/firefox-*.tar.gz";
+    ... )
     >>> browser.getControl("Register Series").click()
 
 Now we are redirected to the Overview page of the product series we just added
@@ -71,9 +71,9 @@ Then we edit the information about the series. First we try to use a
 name already in use and an invalid release URL pattern:
 
     >>> browser.getControl("Name").value = "1.0"
-    >>> browser.getControl(
-    ...     "Summary"
-    ... ).value = "Testing the edit of productseries"
+    >>> browser.getControl("Summary").value = (
+    ...     "Testing the edit of productseries"
+    ... )
     >>> browser.getControl("Release URL pattern").value = "file:///etc"
     >>> browser.getControl("Change").click()
 
@@ -92,9 +92,9 @@ of firefox:
     >>> browser.getControl("Name").value = "unstable"
     >>> browser.getControl("Status").displayValue = ["Experimental"]
     >>> browser.getControl("Branch").value = "main"
-    >>> browser.getControl(
-    ...     "Release URL pattern"
-    ... ).value = "http://ftp.mozilla.org/pub/mozilla.org/firefox-*.tar.gz";
+    >>> browser.getControl("Release URL pattern").value = (
+    ...     "http://ftp.mozilla.org/pub/mozilla.org/firefox-*.tar.gz";
+    ... )
     >>> browser.getControl("Change").click()
 
     >>> browser.url
diff --git a/lib/lp/registry/stories/productseries/xx-productseries-set-branch.rst b/lib/lp/registry/stories/productseries/xx-productseries-set-branch.rst
index 3203c74..16a3848 100644
--- a/lib/lp/registry/stories/productseries/xx-productseries-set-branch.rst
+++ b/lib/lp/registry/stories/productseries/xx-productseries-set-branch.rst
@@ -58,9 +58,9 @@ the branch name to use in Launchpad, and the branch owner.
     >>> browser.getControl("Import a branch hosted somewhere else").click()
     >>> browser.getControl("Branch name").value = "bzr-firefox-branch"
     >>> browser.getControl(name="field.rcs_type").value = ["BZR"]
-    >>> browser.getControl(
-    ...     "Branch URL"
-    ... ).value = "https://bzr.example.com/branch";
+    >>> browser.getControl("Branch URL").value = (
+    ...     "https://bzr.example.com/branch";
+    ... )
     >>> browser.getControl("Update").click()
     >>> print_feedback_messages(browser.contents)
     Code import created and branch linked to the series.
@@ -74,9 +74,9 @@ The process is the same for a Git external branch, though the novel
     >>> browser.getControl("Import a branch hosted somewhere else").click()
     >>> browser.getControl("Branch name").value = "git-firefox-branch"
     >>> browser.getControl(name="field.rcs_type").value = ["GIT"]
-    >>> browser.getControl(
-    ...     "Branch URL"
-    ... ).value = "git://git.example.com/branch"
+    >>> browser.getControl("Branch URL").value = (
+    ...     "git://git.example.com/branch"
+    ... )
     >>> browser.getControl("Update").click()
     >>> print_feedback_messages(browser.contents)
     Code import created and branch linked to the series.
@@ -89,9 +89,9 @@ Likewise Subversion can use the "svn://" scheme.
     >>> browser.getControl("Import a branch hosted somewhere else").click()
     >>> browser.getControl("Branch name").value = "svn-firefox-branch"
     >>> browser.getControl(name="field.rcs_type").value = ["BZR_SVN"]
-    >>> browser.getControl(
-    ...     "Branch URL"
-    ... ).value = "svn://svn.example.com/branch"
+    >>> browser.getControl("Branch URL").value = (
+    ...     "svn://svn.example.com/branch"
+    ... )
     >>> browser.getControl("Update").click()
     >>> print_feedback_messages(browser.contents)
     Code import created and branch linked to the series.
@@ -104,9 +104,9 @@ The branch owner can be the logged in user or one of their teams.
     >>> browser.getControl("Import a branch hosted somewhere else").click()
     >>> browser.getControl("Branch name").value = "git-firefox-branch"
     >>> browser.getControl(name="field.rcs_type").value = ["GIT"]
-    >>> browser.getControl(
-    ...     "Branch URL"
-    ... ).value = "http://git.example.com/branch";
+    >>> browser.getControl("Branch URL").value = (
+    ...     "http://git.example.com/branch";
+    ... )
     >>> browser.getControl("Branch owner").value = ["hwdb-team"]
     >>> browser.getControl("Update").click()
     >>> print_feedback_messages(browser.contents)
diff --git a/lib/lp/registry/stories/project/xx-project-add-product.rst b/lib/lp/registry/stories/project/xx-project-add-product.rst
index 5a1f0e8..6df6158 100644
--- a/lib/lp/registry/stories/project/xx-project-add-product.rst
+++ b/lib/lp/registry/stories/project/xx-project-add-product.rst
@@ -17,9 +17,9 @@ 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/project/xx-project-add.rst b/lib/lp/registry/stories/project/xx-project-add.rst
index d68a090..56c0f66 100644
--- a/lib/lp/registry/stories/project/xx-project-add.rst
+++ b/lib/lp/registry/stories/project/xx-project-add.rst
@@ -19,13 +19,13 @@ Testing if the validator is working for the URL field.
 Add a new project without the http://
 
     >>> admin_browser.getControl("Name", index=0).value = "kde"
-    >>> admin_browser.getControl(
-    ...     "Display Name"
-    ... ).value = "K Desktop Environment"
+    >>> admin_browser.getControl("Display Name").value = (
+    ...     "K Desktop Environment"
+    ... )
     >>> admin_browser.getControl("Project Group Summary").value = "KDE"
-    >>> admin_browser.getControl(
-    ...     "Description"
-    ... ).value = "K Desktop Environment"
+    >>> admin_browser.getControl("Description").value = (
+    ...     "K Desktop Environment"
+    ... )
     >>> admin_browser.getControl("Maintainer").value = "cprov"
     >>> admin_browser.getControl("Homepage URL").value = "www.kde.org"
     >>> admin_browser.getControl("Add").click()
@@ -37,13 +37,13 @@ Testing if the validator is working for the name field.
 
     >>> admin_browser.open("http://launchpad.test/projectgroups/+new";)
     >>> admin_browser.getControl("Name", index=0).value = "kde!"
-    >>> admin_browser.getControl(
-    ...     "Display Name"
-    ... ).value = "K Desktop Environment"
+    >>> admin_browser.getControl("Display Name").value = (
+    ...     "K Desktop Environment"
+    ... )
     >>> admin_browser.getControl("Project Group Summary").value = "KDE"
-    >>> admin_browser.getControl(
-    ...     "Description"
-    ... ).value = "K Desktop Environment"
+    >>> admin_browser.getControl("Description").value = (
+    ...     "K Desktop Environment"
+    ... )
     >>> admin_browser.getControl("Maintainer").value = "cprov"
     >>> admin_browser.getControl("Homepage URL").value = "http://kde.org/";
     >>> admin_browser.getControl("Add").click()
diff --git a/lib/lp/registry/stories/team-polls/create-polls.rst b/lib/lp/registry/stories/team-polls/create-polls.rst
index d12afbb..014c6c9 100644
--- a/lib/lp/registry/stories/team-polls/create-polls.rst
+++ b/lib/lp/registry/stories/team-polls/create-polls.rst
@@ -44,9 +44,9 @@ test the name field validator.
     >>> team_admin_browser.getControl(
     ...     "The unique name of this poll"
     ... ).value = "election_2100"
-    >>> team_admin_browser.getControl(
-    ...     "The title of this poll"
-    ... ).value = "Presidential Election 2100"
+    >>> team_admin_browser.getControl("The title of this poll").value = (
+    ...     "Presidential Election 2100"
+    ... )
     >>> proposition = "Who is going to be the next president?"
     >>> team_admin_browser.getControl(
     ...     "The proposition that is going to be voted"
@@ -54,12 +54,12 @@ test the name field validator.
     >>> team_admin_browser.getControl(
     ...     "Users can spoil their votes?"
     ... ).selected = True
-    >>> team_admin_browser.getControl(
-    ...     name="field.dateopens"
-    ... ).value = "2100-06-04 02:00:00+00:00"
-    >>> team_admin_browser.getControl(
-    ...     name="field.datecloses"
-    ... ).value = "2100-07-04 02:00:00+00:00"
+    >>> team_admin_browser.getControl(name="field.dateopens").value = (
+    ...     "2100-06-04 02:00:00+00:00"
+    ... )
+    >>> team_admin_browser.getControl(name="field.datecloses").value = (
+    ...     "2100-07-04 02:00:00+00:00"
+    ... )
     >>> team_admin_browser.getControl("Continue").click()
 
     >>> print_feedback_messages(team_admin_browser.contents)
@@ -71,12 +71,12 @@ We fix the name, but swap the dates. Again a nice error message.
     >>> team_admin_browser.getControl(
     ...     "The unique name of this poll"
     ... ).value = "election-2100"
-    >>> team_admin_browser.getControl(
-    ...     name="field.dateopens"
-    ... ).value = "2100-07-04 02:00:00+00:00"
-    >>> team_admin_browser.getControl(
-    ...     name="field.datecloses"
-    ... ).value = "2100-06-04 02:00:00+00:00"
+    >>> team_admin_browser.getControl(name="field.dateopens").value = (
+    ...     "2100-07-04 02:00:00+00:00"
+    ... )
+    >>> team_admin_browser.getControl(name="field.datecloses").value = (
+    ...     "2100-06-04 02:00:00+00:00"
+    ... )
     >>> team_admin_browser.getControl("Continue").click()
 
     >>> print_feedback_messages(team_admin_browser.contents)
@@ -85,12 +85,12 @@ We fix the name, but swap the dates. Again a nice error message.
 
 Now we get it right.
 
-    >>> team_admin_browser.getControl(
-    ...     name="field.dateopens"
-    ... ).value = "2100-06-04 02:00:00+00:00"
-    >>> team_admin_browser.getControl(
-    ...     name="field.datecloses"
-    ... ).value = "2100-07-04 02:00:00+00:00"
+    >>> team_admin_browser.getControl(name="field.dateopens").value = (
+    ...     "2100-06-04 02:00:00+00:00"
+    ... )
+    >>> team_admin_browser.getControl(name="field.datecloses").value = (
+    ...     "2100-07-04 02:00:00+00:00"
+    ... )
     >>> team_admin_browser.getControl("Continue").click()
 
 We're redirected to the newly created poll page.
@@ -124,9 +124,9 @@ Create a new poll that starts tomorrow and will last for ten years.
     ...     "Users can spoil their votes?"
     ... ).selected = True
     >>> team_admin_browser.getControl(name="field.dateopens").value = tomorrow
-    >>> team_admin_browser.getControl(
-    ...     name="field.datecloses"
-    ... ).value = ten_years_from_now
+    >>> team_admin_browser.getControl(name="field.datecloses").value = (
+    ...     ten_years_from_now
+    ... )
     >>> team_admin_browser.getControl("Continue").click()
 
 We're redirected to the newly created poll
@@ -171,9 +171,9 @@ Now lets try to insert a poll with the name of a existing one.
     ...     "Users can spoil their votes?"
     ... ).selected = True
     >>> team_admin_browser.getControl(name="field.dateopens").value = tomorrow
-    >>> team_admin_browser.getControl(
-    ...     name="field.datecloses"
-    ... ).value = ten_years_from_now
+    >>> team_admin_browser.getControl(name="field.datecloses").value = (
+    ...     ten_years_from_now
+    ... )
     >>> team_admin_browser.getControl("Continue").click()
 
     >>> print_feedback_messages(team_admin_browser.contents)
diff --git a/lib/lp/registry/stories/team-polls/edit-poll.rst b/lib/lp/registry/stories/team-polls/edit-poll.rst
index 38a5a3e..1012578 100644
--- a/lib/lp/registry/stories/team-polls/edit-poll.rst
+++ b/lib/lp/registry/stories/team-polls/edit-poll.rst
@@ -46,12 +46,12 @@ message.
     >>> team_admin_browser.getControl(
     ...     "The unique name of this poll"
     ... ).value = "dpl-2080"
-    >>> team_admin_browser.getControl(
-    ...     name="field.dateopens"
-    ... ).value = "3000-11-01 00:00:00+00:00"
-    >>> team_admin_browser.getControl(
-    ...     name="field.datecloses"
-    ... ).value = "3000-01-01 00:00:00+00:00"
+    >>> team_admin_browser.getControl(name="field.dateopens").value = (
+    ...     "3000-11-01 00:00:00+00:00"
+    ... )
+    >>> team_admin_browser.getControl(name="field.datecloses").value = (
+    ...     "3000-01-01 00:00:00+00:00"
+    ... )
     >>> team_admin_browser.getControl("Save").click()
 
     >>> print_feedback_messages(team_admin_browser.contents)
@@ -63,12 +63,12 @@ We successfully change the polls name
     >>> team_admin_browser.getControl(
     ...     "The unique name of this poll"
     ... ).value = "election-3000"
-    >>> team_admin_browser.getControl(
-    ...     name="field.dateopens"
-    ... ).value = "3000-01-01 00:00:00+00:00"
-    >>> team_admin_browser.getControl(
-    ...     name="field.datecloses"
-    ... ).value = "3000-11-01 00:00:00+00:00"
+    >>> team_admin_browser.getControl(name="field.dateopens").value = (
+    ...     "3000-01-01 00:00:00+00:00"
+    ... )
+    >>> team_admin_browser.getControl(name="field.datecloses").value = (
+    ...     "3000-11-01 00:00:00+00:00"
+    ... )
     >>> team_admin_browser.getControl("Save").click()
 
     >>> team_admin_browser.url
diff --git a/lib/lp/registry/stories/team/xx-team-claim.rst b/lib/lp/registry/stories/team/xx-team-claim.rst
index 3c5b610..c8605a8 100644
--- a/lib/lp/registry/stories/team/xx-team-claim.rst
+++ b/lib/lp/registry/stories/team/xx-team-claim.rst
@@ -41,9 +41,9 @@ hidden.
 Now we enter the doc team's email address to continue the process of
 turning that profile into a team.
 
-    >>> user_browser.getControl(
-    ...     "Email address"
-    ... ).value = "doc@xxxxxxxxxxxxxxxx"
+    >>> user_browser.getControl("Email address").value = (
+    ...     "doc@xxxxxxxxxxxxxxxx"
+    ... )
     >>> user_browser.getControl("Continue").click()
     >>> user_browser.title
     'Ubuntu Doc Team does not use Launchpad'
diff --git a/lib/lp/registry/stories/team/xx-team-contactemail-xss.rst b/lib/lp/registry/stories/team/xx-team-contactemail-xss.rst
index 1ac9526..4a9b781 100644
--- a/lib/lp/registry/stories/team/xx-team-contactemail-xss.rst
+++ b/lib/lp/registry/stories/team/xx-team-contactemail-xss.rst
@@ -6,9 +6,9 @@ escaped in order to prevent XSS.
 
     >>> admin_browser.open("http://launchpad.test/~guadamen/+contactaddress";)
     >>> admin_browser.getControl("Another email address").selected = True
-    >>> admin_browser.getControl(
-    ...     name="field.contact_address"
-    ... ).value = '<script>alert("cheezburger");</script>'
+    >>> admin_browser.getControl(name="field.contact_address").value = (
+    ...     '<script>alert("cheezburger");</script>'
+    ... )
     >>> admin_browser.getControl("Change").click()
 
 The value can be obtained correctly, which indicates that the markup
diff --git a/lib/lp/registry/stories/team/xx-team-contactemail.rst b/lib/lp/registry/stories/team/xx-team-contactemail.rst
index c858b2b..cdb27fa 100644
--- a/lib/lp/registry/stories/team/xx-team-contactemail.rst
+++ b/lib/lp/registry/stories/team/xx-team-contactemail.rst
@@ -46,9 +46,9 @@ Changing the contact address to an external address will require the
 user to go through the email address confirmation process.
 
     >>> browser.getControl("Another email address").selected = True
-    >>> browser.getControl(
-    ...     name="field.contact_address"
-    ... ).value = "foo@xxxxxxxxxxx"
+    >>> browser.getControl(name="field.contact_address").value = (
+    ...     "foo@xxxxxxxxxxx"
+    ... )
     >>> browser.getControl("Change").click()
     >>> browser.title
     'Landscape Developers in Launchpad'
diff --git a/lib/lp/registry/stories/teammembership/xx-add-member.rst b/lib/lp/registry/stories/teammembership/xx-add-member.rst
index c8ea2b2..4fe2f6d 100644
--- a/lib/lp/registry/stories/teammembership/xx-add-member.rst
+++ b/lib/lp/registry/stories/teammembership/xx-add-member.rst
@@ -122,9 +122,9 @@ the Launchpad Developers.
     >>> browser.url
     'http://launchpad.test/~launchpad/+invitation/landscape-developers'
 
-    >>> browser.getControl(
-    ...     name="field.acknowledger_comment"
-    ... ).value = "This is just a test"
+    >>> browser.getControl(name="field.acknowledger_comment").value = (
+    ...     "This is just a test"
+    ... )
     >>> browser.getControl("Accept").click()
 
     >>> browser.url
diff --git a/lib/lp/registry/stories/teammembership/xx-teammembership.rst b/lib/lp/registry/stories/teammembership/xx-teammembership.rst
index 9d1e8a7..761333e 100644
--- a/lib/lp/registry/stories/teammembership/xx-teammembership.rst
+++ b/lib/lp/registry/stories/teammembership/xx-teammembership.rst
@@ -341,9 +341,9 @@ in the past, so we'll approve his membership.
     >>> browser.url
     'http://launchpad.test/~myemail/+member/jblack'
 
-    >>> browser.getControl(
-    ...     name="membership.expirationdate"
-    ... ).value = "2048-04-14"
+    >>> browser.getControl(name="membership.expirationdate").value = (
+    ...     "2048-04-14"
+    ... )
     >>> browser.getControl(name="approve").click()
 
     >>> browser.url
@@ -423,9 +423,9 @@ possible.
 
     >>> browser.open("http://launchpad.test/~myemail/+member/karl";)
     >>> browser.getControl(name="expires").value = ["date"]
-    >>> browser.getControl(
-    ...     name="membership.expirationdate"
-    ... ).value = "2049-04-16"
+    >>> browser.getControl(name="membership.expirationdate").value = (
+    ...     "2049-04-16"
+    ... )
     >>> browser.getControl("Reactivate").click()
 
     >>> browser.url
@@ -442,9 +442,9 @@ A second submission for reactivation should not crash but will print an
 error message:
 
     >>> browser2.getControl(name="expires").value = ["date"]
-    >>> browser2.getControl(
-    ...     name="membership.expirationdate"
-    ... ).value = "2049-04-16"
+    >>> browser2.getControl(name="membership.expirationdate").value = (
+    ...     "2049-04-16"
+    ... )
     >>> browser2.getControl("Reactivate").click()
     >>> browser2.url
     'http://launchpad.test/~myemail/+member/karl/+index'
diff --git a/lib/lp/registry/tests/test_distribution.py b/lib/lp/registry/tests/test_distribution.py
index 10810e7..c1fafdd 100644
--- a/lib/lp/registry/tests/test_distribution.py
+++ b/lib/lp/registry/tests/test_distribution.py
@@ -831,9 +831,9 @@ class TestDistribution(TestCaseWithFactory):
         self.assertContentEqual(
             [InformationType.PROPRIETARY], [ap.type for ap in aps]
         )
-        removeSecurityProxy(
-            distribution
-        ).information_type = InformationType.PUBLIC
+        removeSecurityProxy(distribution).information_type = (
+            InformationType.PUBLIC
+        )
         aps = getUtility(IAccessPolicySource).findByPillar([distribution])
         self.assertContentEqual(
             [InformationType.PROPRIETARY], [ap.type for ap in aps]
diff --git a/lib/lp/registry/tests/test_distributionsourcepackage.py b/lib/lp/registry/tests/test_distributionsourcepackage.py
index 94fef20..c8efd8e 100644
--- a/lib/lp/registry/tests/test_distributionsourcepackage.py
+++ b/lib/lp/registry/tests/test_distributionsourcepackage.py
@@ -494,9 +494,9 @@ class TestDistributionSourcePackageInDatabase(TestCaseWithFactory):
             distribution, self.factory.makeSourcePackageName()
         )
         bogus_dsp_cache_key = distribution.id, sourcepackagename.id
-        DistributionSourcePackageInDatabase._cache[
-            bogus_dsp_cache_key
-        ] = bogus_dsp.id
+        DistributionSourcePackageInDatabase._cache[bogus_dsp_cache_key] = (
+            bogus_dsp.id
+        )
         # Invalidate the bogus DSP from Storm's cache.
         Store.of(bogus_dsp).invalidate(bogus_dsp)
         flush_database_updates()
@@ -521,9 +521,9 @@ class TestDistributionSourcePackageInDatabase(TestCaseWithFactory):
             distribution, self.factory.makeSourcePackageName()
         )
         bogus_dsp_cache_key = distribution.id, sourcepackagename.id
-        DistributionSourcePackageInDatabase._cache[
-            bogus_dsp_cache_key
-        ] = bogus_dsp.id
+        DistributionSourcePackageInDatabase._cache[bogus_dsp_cache_key] = (
+            bogus_dsp.id
+        )
         flush_database_updates()
         with StormStatementRecorder() as recorder:
             dsp = DistributionSourcePackageInDatabase.get(
diff --git a/lib/lp/registry/tests/test_distroseriesdifference.py b/lib/lp/registry/tests/test_distroseriesdifference.py
index cefef7b..113c7fc 100644
--- a/lib/lp/registry/tests/test_distroseriesdifference.py
+++ b/lib/lp/registry/tests/test_distroseriesdifference.py
@@ -1570,9 +1570,9 @@ class TestMostRecentPublications(TestCaseWithFactory):
         derived_series = dsp.derived_series
         dsd = self.create_difference(derived_series)
         # Change the derived source publication to DELETED.
-        removeSecurityProxy(
-            dsd.source_pub
-        ).status = PackagePublishingStatus.DELETED
+        removeSecurityProxy(dsd.source_pub).status = (
+            PackagePublishingStatus.DELETED
+        )
         # Searching for DELETED will find the source publication.
         self.assertContentEqual(
             [(dsd.source_package_name.id, dsd.source_pub)],
diff --git a/lib/lp/registry/tests/test_person.py b/lib/lp/registry/tests/test_person.py
index 5381103..c3d7e84 100644
--- a/lib/lp/registry/tests/test_person.py
+++ b/lib/lp/registry/tests/test_person.py
@@ -2007,9 +2007,9 @@ class Test_getAssignedBugTasksDueBefore(TestCaseWithFactory):
 
     def test_skips_productseries_task_that_is_a_conjoined_primary(self):
         milestone = self.factory.makeMilestone(dateexpected=self.today)
-        removeSecurityProxy(
-            milestone.product
-        ).development_focus = milestone.productseries
+        removeSecurityProxy(milestone.product).development_focus = (
+            milestone.productseries
+        )
         bug = self.factory.makeBug(
             series=milestone.productseries, milestone=milestone
         )
@@ -2141,9 +2141,9 @@ class TestSpecifications(TestCaseWithFactory):
             information_type=information_type,
             owner=owner,
         )
-        removeSecurityProxy(
-            blueprint
-        ).datecreated = self.date_created + timedelta(date_created)
+        removeSecurityProxy(blueprint).datecreated = (
+            self.date_created + timedelta(date_created)
+        )
         return blueprint
 
     def test_specifications_quantity(self):
diff --git a/lib/lp/registry/tests/test_personmerge.py b/lib/lp/registry/tests/test_personmerge.py
index 5722ddd..fcc5245 100644
--- a/lib/lp/registry/tests/test_personmerge.py
+++ b/lib/lp/registry/tests/test_personmerge.py
@@ -387,9 +387,9 @@ class TestMergePeople(TestCaseWithFactory, KarmaTestMixin):
         with person_logged_in(person):
             # The description lets us show that we still have the right
             # subscription later.
-            target.addBugSubscriptionFilter(
-                person, person
-            ).description = "a marker"
+            target.addBugSubscriptionFilter(person, person).description = (
+                "a marker"
+            )
         self._do_premerge(duplicate, person)
         login_person(person)
         duplicate, person = self._do_merge(duplicate, person)
diff --git a/lib/lp/registry/tests/test_product.py b/lib/lp/registry/tests/test_product.py
index cde2dcd..faf885b 100644
--- a/lib/lp/registry/tests/test_product.py
+++ b/lib/lp/registry/tests/test_product.py
@@ -2349,9 +2349,9 @@ class TestSpecifications(TestCaseWithFactory):
             information_type=information_type,
             product=product,
         )
-        removeSecurityProxy(
-            blueprint
-        ).datecreated = self.date_created + timedelta(date_created)
+        removeSecurityProxy(blueprint).datecreated = (
+            self.date_created + timedelta(date_created)
+        )
         return blueprint
 
     def test_specifications_quantity(self):
diff --git a/lib/lp/registry/tests/test_productjob.py b/lib/lp/registry/tests/test_productjob.py
index 836f33e..73d8fe8 100644
--- a/lib/lp/registry/tests/test_productjob.py
+++ b/lib/lp/registry/tests/test_productjob.py
@@ -62,17 +62,17 @@ class CommercialHelpers:
         expired_date = (
             product.commercial_subscription.date_expires - timedelta(days=365)
         )
-        removeSecurityProxy(
-            product.commercial_subscription
-        ).date_expires = expired_date
+        removeSecurityProxy(product.commercial_subscription).date_expires = (
+            expired_date
+        )
 
     def make_expiring_product(self, date_expires, job_class=None):
         product = self.factory.makeProduct(
             licenses=[License.OTHER_PROPRIETARY]
         )
-        removeSecurityProxy(
-            product.commercial_subscription
-        ).date_expires = date_expires
+        removeSecurityProxy(product.commercial_subscription).date_expires = (
+            date_expires
+        )
         if job_class:
             reviewer = getUtility(ILaunchpadCelebrities).janitor
             job_class.create(product, reviewer)
diff --git a/lib/lp/registry/tests/test_sharingjob.py b/lib/lp/registry/tests/test_sharingjob.py
index 617c7cf..eb0c0bf 100644
--- a/lib/lp/registry/tests/test_sharingjob.py
+++ b/lib/lp/registry/tests/test_sharingjob.py
@@ -721,41 +721,41 @@ class RemoveArtifactSubscriptionsJobTestCase(TestCaseWithFactory):
 
     def test_change_information_type_branch(self):
         def change_information_type(branch):
-            removeSecurityProxy(
-                branch
-            ).information_type = InformationType.PRIVATESECURITY
+            removeSecurityProxy(branch).information_type = (
+                InformationType.PRIVATESECURITY
+            )
 
         self._assert_branch_change_unsubscribes(change_information_type)
 
     def test_change_information_type_gitrepository(self):
         def change_information_type(gitrepository):
-            removeSecurityProxy(
-                gitrepository
-            ).information_type = InformationType.PRIVATESECURITY
+            removeSecurityProxy(gitrepository).information_type = (
+                InformationType.PRIVATESECURITY
+            )
 
         self._assert_gitrepository_change_unsubscribes(change_information_type)
 
     def test_change_information_type_snap(self):
         def change_information_type(snap):
-            removeSecurityProxy(
-                snap
-            ).information_type = InformationType.PRIVATESECURITY
+            removeSecurityProxy(snap).information_type = (
+                InformationType.PRIVATESECURITY
+            )
 
         self._assert_snap_change_unsubscribes(change_information_type)
 
     def test_change_information_type_specification(self):
         def change_information_type(specification):
-            removeSecurityProxy(
-                specification
-            ).information_type = InformationType.EMBARGOED
+            removeSecurityProxy(specification).information_type = (
+                InformationType.EMBARGOED
+            )
 
         self._assert_specification_change_unsubscribes(change_information_type)
 
     def test_change_information_type_ocirecipe(self):
         def change_information_type(ocirecipe):
-            removeSecurityProxy(
-                ocirecipe
-            ).information_type = InformationType.PRIVATESECURITY
+            removeSecurityProxy(ocirecipe).information_type = (
+                InformationType.PRIVATESECURITY
+            )
 
         self._assert_ocirecipe_change_unsubscribes(change_information_type)
 
@@ -765,9 +765,9 @@ class RemoveArtifactSubscriptionsJobTestCase(TestCaseWithFactory):
         def change_information_type(bug):
             # Set the info_type attribute directly since
             # transitionToInformationType queues a job.
-            removeSecurityProxy(
-                bug
-            ).information_type = InformationType.PRIVATESECURITY
+            removeSecurityProxy(bug).information_type = (
+                InformationType.PRIVATESECURITY
+            )
 
         self._assert_bug_change_unsubscribes(change_information_type)
 
diff --git a/lib/lp/registry/tests/test_ssh.py b/lib/lp/registry/tests/test_ssh.py
index a3448bf..2f7351c 100644
--- a/lib/lp/registry/tests/test_ssh.py
+++ b/lib/lp/registry/tests/test_ssh.py
@@ -136,7 +136,6 @@ class TestSSHKey(TestCaseWithFactory):
 
 
 class TestSSHKeySet(TestCaseWithFactory):
-
     """Test `ISSHKeySet`."""
 
     layer = DatabaseFunctionalLayer
diff --git a/lib/lp/registry/tests/test_teammembership.py b/lib/lp/registry/tests/test_teammembership.py
index 14372cc..a5d9d9b 100644
--- a/lib/lp/registry/tests/test_teammembership.py
+++ b/lib/lp/registry/tests/test_teammembership.py
@@ -643,6 +643,7 @@ class TestTeamParticipationMesh(TeamParticipationTestCase):
                  team5
                     no-priv
     """
+
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
diff --git a/lib/lp/scripts/tests/test_garbo.py b/lib/lp/scripts/tests/test_garbo.py
index eaa20e9..8aee9c5 100644
--- a/lib/lp/scripts/tests/test_garbo.py
+++ b/lib/lp/scripts/tests/test_garbo.py
@@ -1732,12 +1732,12 @@ class TestGarbo(FakeAdapterMixin, TestCaseWithFactory):
         )
 
         # Some of the creators and maintainers have inactive accounts.
-        removeSecurityProxy(
-            creators[2].account
-        ).status = AccountStatus.DEACTIVATED
-        removeSecurityProxy(
-            maintainers[2].account
-        ).status = AccountStatus.CLOSED
+        removeSecurityProxy(creators[2].account).status = (
+            AccountStatus.DEACTIVATED
+        )
+        removeSecurityProxy(maintainers[2].account).status = (
+            AccountStatus.CLOSED
+        )
 
         transaction.commit()
         self.runFrequently()
@@ -1853,9 +1853,9 @@ class TestGarbo(FakeAdapterMixin, TestCaseWithFactory):
 
         livefsbuild_kwargs = dict(livefsbuild_kwargs)
         if keep_binary_files_days is not _default:
-            livefsbuild_kwargs[
-                "keep_binary_files_days"
-            ] = keep_binary_files_days
+            livefsbuild_kwargs["keep_binary_files_days"] = (
+                keep_binary_files_days
+            )
         db_build = self.factory.makeLiveFSBuild(
             date_created=now - timedelta(days=interval, minutes=15),
             status=BuildStatus.FULLYBUILT,
@@ -2537,9 +2537,9 @@ class TestGarbo(FakeAdapterMixin, TestCaseWithFactory):
         switch_dbuser("testadmin")
         now = datetime.now(timezone.utc)
         archive_files = [self.factory.makeArchiveFile() for _ in range(2)]
-        removeSecurityProxy(
-            archive_files[1]
-        ).scheduled_deletion_date = now + timedelta(hours=6)
+        removeSecurityProxy(archive_files[1]).scheduled_deletion_date = (
+            now + timedelta(hours=6)
+        )
 
         self.runDaily()
 
@@ -2569,10 +2569,8 @@ class TestGarbo(FakeAdapterMixin, TestCaseWithFactory):
         )
         self.assertIsNotNone(archive_files[0].date_superseded)
 
-        removeSecurityProxy(
-            archive_files[1]
-        ).scheduled_deletion_date = datetime.now(timezone.utc) + timedelta(
-            days=1
+        removeSecurityProxy(archive_files[1]).scheduled_deletion_date = (
+            datetime.now(timezone.utc) + timedelta(days=1)
         )
         self.assertIsNone(archive_files[1].date_superseded)
 
@@ -2598,9 +2596,9 @@ class TestGarbo(FakeAdapterMixin, TestCaseWithFactory):
                 (refs[2], b"name: test-snap\nbase: core18\n"),
             )
         }
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob = lambda path, *args, **kwargs: blobs.get(path)
+        self.useFixture(GitHostingFixture()).getBlob = (
+            lambda path, *args, **kwargs: blobs.get(path)
+        )
         old_snaps = [self.factory.makeSnap(git_ref=ref) for ref in refs]
         for snap in old_snaps:
             removeSecurityProxy(snap)._pro_enable = None
diff --git a/lib/lp/services/features/browser/tests/test_feature_editor.py b/lib/lp/services/features/browser/tests/test_feature_editor.py
index 1db5434..789f0b4 100644
--- a/lib/lp/services/features/browser/tests/test_feature_editor.py
+++ b/lib/lp/services/features/browser/tests/test_feature_editor.py
@@ -164,15 +164,15 @@ class TestFeatureControlPage(BrowserTestCase):
         """Submitting shows a diff of the changes."""
         browser = self.admin_browser
         browser.open(self.getFeatureRulesEditURL())
-        browser.getControl(
-            name="field.feature_rules"
-        ).value = "beta_user some_key 10 some value with spaces"
+        browser.getControl(name="field.feature_rules").value = (
+            "beta_user some_key 10 some value with spaces"
+        )
         browser.getControl(name="field.comment").value = "comment"
         browser.getControl(name="field.actions.change").click()
         browser.getControl(name="field.comment").value = "comment"
-        browser.getControl(
-            name="field.feature_rules"
-        ).value = "beta_user some_key 10 another value with spaces"
+        browser.getControl(name="field.feature_rules").value = (
+            "beta_user some_key 10 another value with spaces"
+        )
         browser.getControl(name="field.actions.change").click()
         # The diff is formatted nicely using CSS.
         self.assertThat(
@@ -193,9 +193,9 @@ class TestFeatureControlPage(BrowserTestCase):
         """When submitting changes the name of the logger is shown."""
         browser = self.admin_browser
         browser.open(self.getFeatureRulesEditURL())
-        browser.getControl(
-            name="field.feature_rules"
-        ).value = "beta_user some_key 10 some value with spaces"
+        browser.getControl(name="field.feature_rules").value = (
+            "beta_user some_key 10 some value with spaces"
+        )
         browser.getControl(name="field.comment").value = "comment"
         browser.getControl(name="field.actions.change").click()
         self.assertThat(
diff --git a/lib/lp/services/librarianserver/web.py b/lib/lp/services/librarianserver/web.py
index efa7f55..f027cfd 100644
--- a/lib/lp/services/librarianserver/web.py
+++ b/lib/lp/services/librarianserver/web.py
@@ -184,9 +184,11 @@ class LibraryFileAliasResource(resource.Resource):
             # cached forever, while private ones mustn't be at all.
             request.setHeader(
                 "Cache-Control",
-                "max-age=31536000, public"
-                if not restricted
-                else "max-age=0, private",
+                (
+                    "max-age=31536000, public"
+                    if not restricted
+                    else "max-age=0, private"
+                ),
             )
             return file
         elif self.upstreamHost is not None:
diff --git a/lib/lp/services/profile/profile.py b/lib/lp/services/profile/profile.py
index 7c7cd4b..7e6cdc1 100644
--- a/lib/lp/services/profile/profile.py
+++ b/lib/lp/services/profile/profile.py
@@ -463,9 +463,7 @@ def end_request(event):
             step["sql_class"] = (
                 "sql_danger"
                 if key > 500
-                else "sql_warning"
-                if key > 100
-                else None
+                else "sql_warning" if key > 100 else None
             )
             top_sql_ids.append(
                 dict(
@@ -481,9 +479,7 @@ def end_request(event):
             step["python_class"] = (
                 "python_danger"
                 if key > 500
-                else "python_warning"
-                if key > 100
-                else None
+                else "python_warning" if key > 100 else None
             )
             top_python_ids.append(
                 dict(
diff --git a/lib/lp/services/signing/testing/fixture.py b/lib/lp/services/signing/testing/fixture.py
index e84af2c..02f70ec 100644
--- a/lib/lp/services/signing/testing/fixture.py
+++ b/lib/lp/services/signing/testing/fixture.py
@@ -92,10 +92,8 @@ class SigningServiceFixture(TacTestFixture):
         self.client_private_key = PrivateKey.generate()
 
         os.environ["FAKE_SIGNING_PORT"] = str(self.daemon_port)
-        os.environ[
-            "FAKE_SIGNING_CLIENT_PUBLIC_KEY"
-        ] = self.client_private_key.public_key.encode(
-            encoder=Base64Encoder
-        ).decode(
-            "ASCII"
+        os.environ["FAKE_SIGNING_CLIENT_PUBLIC_KEY"] = (
+            self.client_private_key.public_key.encode(
+                encoder=Base64Encoder
+            ).decode("ASCII")
         )
diff --git a/lib/lp/services/twistedsupport/tests/test_processmonitor.py b/lib/lp/services/twistedsupport/tests/test_processmonitor.py
index 3bdd8fc..29492c3 100644
--- a/lib/lp/services/twistedsupport/tests/test_processmonitor.py
+++ b/lib/lp/services/twistedsupport/tests/test_processmonitor.py
@@ -127,7 +127,6 @@ class TestProcessWithTimeout(ProcessTestsMixin, TestCase):
 
 
 class TestProcessProtocolWithTwoStageKill(ProcessTestsMixin, TestCase):
-
     """Tests for `ProcessProtocolWithTwoStageKill`."""
 
     run_tests_with = AsynchronousDeferredRunTest
diff --git a/lib/lp/services/webapp/tests/test_dbpolicy.py b/lib/lp/services/webapp/tests/test_dbpolicy.py
index a88d351..0428cee 100644
--- a/lib/lp/services/webapp/tests/test_dbpolicy.py
+++ b/lib/lp/services/webapp/tests/test_dbpolicy.py
@@ -365,9 +365,9 @@ class TestFastDowntimeRollout(TestCase):
         self.standby_dbname = self.primary_dbname + "_standby"
 
         self.pgbouncer_fixture = PGBouncerFixture()
-        self.pgbouncer_fixture.databases[
-            self.standby_dbname
-        ] = self.pgbouncer_fixture.databases[self.primary_dbname]
+        self.pgbouncer_fixture.databases[self.standby_dbname] = (
+            self.pgbouncer_fixture.databases[self.primary_dbname]
+        )
 
         # Configure primary and standby connections to go via different
         # pgbouncer aliases.
diff --git a/lib/lp/services/webhooks/tests/test_webservice.py b/lib/lp/services/webhooks/tests/test_webservice.py
index f7d9d0b..53f7e93 100644
--- a/lib/lp/services/webhooks/tests/test_webservice.py
+++ b/lib/lp/services/webhooks/tests/test_webservice.py
@@ -323,9 +323,9 @@ class TestWebhookDelivery(TestCaseWithFactory):
     def test_retry(self):
         with person_logged_in(self.owner):
             self.delivery.start()
-            removeSecurityProxy(self.delivery).json_data[
-                "date_first_sent"
-            ] = datetime.now(timezone.utc).isoformat()
+            removeSecurityProxy(self.delivery).json_data["date_first_sent"] = (
+                datetime.now(timezone.utc).isoformat()
+            )
             self.delivery.fail()
         representation = self.webservice.get(
             self.delivery_url, api_version="devel"
diff --git a/lib/lp/snappy/browser/snap.py b/lib/lp/snappy/browser/snap.py
index b783dcd..5744565 100644
--- a/lib/lp/snappy/browser/snap.py
+++ b/lib/lp/snappy/browser/snap.py
@@ -1024,9 +1024,9 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin):
         else:
             initial_values["vcs"] = VCSType.BZR
         if self.context.auto_build_pocket is None:
-            initial_values[
-                "auto_build_pocket"
-            ] = PackagePublishingPocket.UPDATES
+            initial_values["auto_build_pocket"] = (
+                PackagePublishingPocket.UPDATES
+            )
         # XXX pappacena 2021-02-12: Until we back fill information_type
         # database column, it will be NULL, but snap.information_type
         # property has a fallback to check "private" property. This should
diff --git a/lib/lp/snappy/browser/tests/test_snap.py b/lib/lp/snappy/browser/tests/test_snap.py
index 2de0693..cb4d4de 100644
--- a/lib/lp/snappy/browser/tests/test_snap.py
+++ b/lib/lp/snappy/browser/tests/test_snap.py
@@ -336,9 +336,9 @@ class TestSnapAddView(BaseTestSnapView):
         )
         browser.getControl(name="field.name").value = "snap-name"
         browser.getControl(name="field.vcs").value = "GIT"
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = git_ref_shortened_path
+        browser.getControl(name="field.git_ref.repository").value = (
+            git_ref_shortened_path
+        )
         browser.getControl(name="field.git_ref.path").value = git_ref_path
         browser.getControl("Create snap package").click()
 
@@ -548,19 +548,19 @@ class TestSnapAddView(BaseTestSnapView):
             "Automatically build when branch changes"
         ).selected = True
         browser.getControl("PPA").click()
-        browser.getControl(
-            name="field.auto_build_archive.ppa"
-        ).value = archive.reference
+        browser.getControl(name="field.auto_build_archive.ppa").value = (
+            archive.reference
+        )
         browser.getControl("Pocket for automatic builds").value = ["SECURITY"]
-        browser.getControl(
-            name="field.auto_build_channels.core"
-        ).value = "stable"
-        browser.getControl(
-            name="field.auto_build_channels.core18"
-        ).value = "beta"
-        browser.getControl(
-            name="field.auto_build_channels.core20"
-        ).value = "edge/feature"
+        browser.getControl(name="field.auto_build_channels.core").value = (
+            "stable"
+        )
+        browser.getControl(name="field.auto_build_channels.core18").value = (
+            "beta"
+        )
+        browser.getControl(name="field.auto_build_channels.core20").value = (
+            "edge/feature"
+        )
         browser.getControl(
             name="field.auto_build_channels.snapcraft"
         ).value = "edge"
@@ -598,13 +598,13 @@ class TestSnapAddView(BaseTestSnapView):
         browser = self.getNonRedirectingBrowser(url=view_url, user=self.person)
         browser.getControl(name="field.name").value = "snap-name"
         browser.getControl("Automatically upload to store").selected = True
-        browser.getControl(
-            "Registered store package name"
-        ).value = "store-name"
+        browser.getControl("Registered store package name").value = (
+            "store-name"
+        )
         self.assertFalse(browser.getControl("Stable").selected)
-        browser.getControl(
-            name="field.store_channels.add_track"
-        ).value = "track"
+        browser.getControl(name="field.store_channels.add_track").value = (
+            "track"
+        )
         browser.getControl(name="field.store_channels.add_risk").value = [
             "edge"
         ]
@@ -967,18 +967,18 @@ class TestSnapEditView(BaseTestSnapView):
             "ubuntu/%s/%s" % (new_series.name, new_snappy_series.name)
         ]
         browser.getControl("Git", index=0).click()
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = new_git_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            new_git_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = new_git_ref_path
         browser.getControl("Build source tarball").selected = True
         browser.getControl(
             "Automatically build when branch changes"
         ).selected = True
         browser.getControl("PPA").click()
-        browser.getControl(
-            name="field.auto_build_archive.ppa"
-        ).value = archive.reference
+        browser.getControl(name="field.auto_build_archive.ppa").value = (
+            archive.reference
+        )
         browser.getControl("Pocket for automatic builds").value = ["SECURITY"]
         browser.getControl(
             name="field.auto_build_channels.snapcraft"
@@ -1040,9 +1040,9 @@ class TestSnapEditView(BaseTestSnapView):
             branch=self.factory.makeAnyBranch(),
         )
         browser = self.getViewBrowser(snap, view_name="+edit", user=snap.owner)
-        browser.getControl(
-            name="field.store_distro_series"
-        ).value = "ubuntu/%s/%s" % (distro_series.name, snappy_series.name)
+        browser.getControl(name="field.store_distro_series").value = (
+            "ubuntu/%s/%s" % (distro_series.name, snappy_series.name)
+        )
         browser.getControl("Update snap package").click()
 
         self.assertEqual([], find_tags_by_class(browser.contents, "message"))
@@ -1387,9 +1387,9 @@ class TestSnapEditView(BaseTestSnapView):
         private_ref_path = private_ref.path
         browser = self.getViewBrowser(snap, user=self.person)
         browser.getLink("Edit snap package").click()
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = private_ref_identity
+        browser.getControl(name="field.git_ref.repository").value = (
+            private_ref_identity
+        )
         browser.getControl(name="field.git_ref.path").value = private_ref_path
         browser.getControl("Update snap package").click()
         self.assertEqual(
@@ -1416,9 +1416,9 @@ class TestSnapEditView(BaseTestSnapView):
         )
         browser = self.getViewBrowser(snap, user=self.person)
         browser.getLink("Edit snap package").click()
-        browser.getControl(
-            name="field.git_ref.repository"
-        ).value = new_repository_url
+        browser.getControl(name="field.git_ref.repository").value = (
+            new_repository_url
+        )
         browser.getControl(name="field.git_ref.path").value = new_path
         browser.getControl("Update snap package").click()
         login_person(self.person)
diff --git a/lib/lp/snappy/browser/tests/test_snaplisting.py b/lib/lp/snappy/browser/tests/test_snaplisting.py
index e2092a7..90464bb 100644
--- a/lib/lp/snappy/browser/tests/test_snaplisting.py
+++ b/lib/lp/snappy/browser/tests/test_snaplisting.py
@@ -513,9 +513,9 @@ class TestSnapListing(BrowserTestCase):
     def makeSnapsAndMatchers(self, create_snap, count, start_time):
         snaps = [create_snap() for i in range(count)]
         for i, snap in enumerate(snaps):
-            removeSecurityProxy(
-                snap
-            ).date_last_modified = start_time - timedelta(seconds=i)
+            removeSecurityProxy(snap).date_last_modified = (
+                start_time - timedelta(seconds=i)
+            )
         return [
             soupmatchers.Tag(
                 "snap link",
diff --git a/lib/lp/snappy/model/snap.py b/lib/lp/snappy/model/snap.py
index d5c26e7..eeeb056 100644
--- a/lib/lp/snappy/model/snap.py
+++ b/lib/lp/snappy/model/snap.py
@@ -788,10 +788,10 @@ class Snap(StormBase, WebhookTargetMixin):
                 raise BadMacaroon("discharge_macaroon is invalid.")
             container = getUtility(IEncryptedContainer, "snap-store-secrets")
             if container.can_encrypt:
-                self.store_secrets[
-                    "discharge_encrypted"
-                ] = removeSecurityProxy(
-                    container.encrypt(discharge_macaroon.encode("UTF-8"))
+                self.store_secrets["discharge_encrypted"] = (
+                    removeSecurityProxy(
+                        container.encrypt(discharge_macaroon.encode("UTF-8"))
+                    )
                 )
                 self.store_secrets.pop("discharge", None)
             else:
diff --git a/lib/lp/snappy/model/snapbuildbehaviour.py b/lib/lp/snappy/model/snapbuildbehaviour.py
index e0fa800..66ae7cc 100644
--- a/lib/lp/snappy/model/snapbuildbehaviour.py
+++ b/lib/lp/snappy/model/snapbuildbehaviour.py
@@ -170,9 +170,9 @@ class SnapBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase):
                 )
                 args["git_repository"] = url
             else:
-                args[
-                    "git_repository"
-                ] = build.snap.git_repository.git_https_url
+                args["git_repository"] = (
+                    build.snap.git_repository.git_https_url
+                )
             # "git clone -b" doesn't accept full ref names.  If this becomes
             # a problem then we could change launchpad-buildd to do "git
             # clone" followed by "git checkout" instead.
diff --git a/lib/lp/snappy/tests/test_snap.py b/lib/lp/snappy/tests/test_snap.py
index 167dfdb..8f35aa1 100644
--- a/lib/lp/snappy/tests/test_snap.py
+++ b/lib/lp/snappy/tests/test_snap.py
@@ -294,9 +294,9 @@ class TestSnap(TestCaseWithFactory):
                 (refs[2], b"name: test-snap\nbase: core18\n"),
             )
         }
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob = lambda path, *args, **kwargs: blobs.get(path)
+        self.useFixture(GitHostingFixture()).getBlob = (
+            lambda path, *args, **kwargs: blobs.get(path)
+        )
         snaps = [self.factory.makeSnap(git_ref=ref) for ref in refs]
         for snap in snaps:
             removeSecurityProxy(snap)._pro_enable = None
@@ -2390,9 +2390,9 @@ class TestSnapSet(TestCaseWithFactory):
         components = self.makeSnapComponents(git_ref=ref)
         with admin_logged_in():
             components["information_type"] = InformationType.PROPRIETARY
-            components[
-                "owner"
-            ].membership_policy = TeamMembershipPolicy.MODERATED
+            components["owner"].membership_policy = (
+                TeamMembershipPolicy.MODERATED
+            )
         components["project"] = self.factory.makeProduct(
             information_type=InformationType.PROPRIETARY,
             branch_sharing_policy=BranchSharingPolicy.PROPRIETARY,
@@ -3646,9 +3646,9 @@ class TestSnapProcessors(TestCaseWithFactory):
 
         git_ref = self.factory.makeGitRefs()[0]
         blob = b"name: test-snap\nbase: core18\n"
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob = lambda path, *args, **kwargs: blob
+        self.useFixture(GitHostingFixture()).getBlob = (
+            lambda path, *args, **kwargs: blob
+        )
 
         registrant = self.factory.makePerson()
         components = dict(
@@ -3682,9 +3682,9 @@ class TestSnapProcessors(TestCaseWithFactory):
                 (refs[5], b"name: core18\ntype: base\n"),
             )
         }
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob = lambda path, *args, **kwargs: blobs.get(path)
+        self.useFixture(GitHostingFixture()).getBlob = (
+            lambda path, *args, **kwargs: blobs.get(path)
+        )
 
         inferProEnable = getUtility(ISnapSet).inferProEnable
         self.assertTrue(inferProEnable(refs[0]))  # Snap with no base
@@ -3714,9 +3714,9 @@ class TestSnapProcessors(TestCaseWithFactory):
                 (branches[5], b"name: core18\ntype: base\n"),
             )
         }
-        self.useFixture(
-            BranchHostingFixture()
-        ).getBlob = lambda branch_id, *args, **kwargs: blobs.get(branch_id)
+        self.useFixture(BranchHostingFixture()).getBlob = (
+            lambda branch_id, *args, **kwargs: blobs.get(branch_id)
+        )
 
         inferProEnable = getUtility(ISnapSet).inferProEnable
         self.assertTrue(inferProEnable(branches[0]))  # Snap w no base
diff --git a/lib/lp/snappy/tests/test_snapjob.py b/lib/lp/snappy/tests/test_snapjob.py
index 91d99a5..4717706 100644
--- a/lib/lp/snappy/tests/test_snapjob.py
+++ b/lib/lp/snappy/tests/test_snapjob.py
@@ -238,9 +238,9 @@ class TestSnapRequestBuildsJob(TestCaseWithFactory):
             PackagePublishingPocket.RELEASE,
             {"core": "stable"},
         )
-        self.useFixture(
-            GitHostingFixture()
-        ).getBlob.failure = CannotParseSnapcraftYaml("Nonsense on stilts")
+        self.useFixture(GitHostingFixture()).getBlob.failure = (
+            CannotParseSnapcraftYaml("Nonsense on stilts")
+        )
         with dbuser(config.ISnapRequestBuildsJobSource.dbuser):
             JobRunner([job]).runAll()
         now = get_transaction_timestamp(IStore(snap))
diff --git a/lib/lp/soyuz/adapters/tests/test_overrides.py b/lib/lp/soyuz/adapters/tests/test_overrides.py
index 4599b51..0322462 100644
--- a/lib/lp/soyuz/adapters/tests/test_overrides.py
+++ b/lib/lp/soyuz/adapters/tests/test_overrides.py
@@ -697,13 +697,13 @@ class TestFallbackOverridePolicy(TestCaseWithFactory):
                 pocket=pocket,
             )
             spns.append(spph.sourcepackagerelease.sourcepackagename)
-            expected[
-                spph.sourcepackagerelease.sourcepackagename
-            ] = SourceOverride(
-                component=spph.component,
-                section=spph.section,
-                version=spph.sourcepackagerelease.version,
-                new=False,
+            expected[spph.sourcepackagerelease.sourcepackagename] = (
+                SourceOverride(
+                    component=spph.component,
+                    section=spph.section,
+                    version=spph.sourcepackagerelease.version,
+                    new=False,
+                )
             )
         spns.append(self.factory.makeSourcePackageName())
         expected[spns[-1]] = SourceOverride(component=universe, new=True)
diff --git a/lib/lp/soyuz/browser/archive.py b/lib/lp/soyuz/browser/archive.py
index 61186a3..fc82b21 100644
--- a/lib/lp/soyuz/browser/archive.py
+++ b/lib/lp/soyuz/browser/archive.py
@@ -2304,9 +2304,11 @@ class EnableProcessorsMixin:
                 title=old_field.title,
                 value_type=Choice(vocabulary=SimpleVocabulary(terms)),
                 required=False,
-                description=old_field.description
-                if description is None
-                else description,
+                description=(
+                    old_field.description
+                    if description is None
+                    else description
+                ),
             ),
             render_context=self.render_context,
             custom_widget=widget,
diff --git a/lib/lp/soyuz/browser/queue.py b/lib/lp/soyuz/browser/queue.py
index ff942aa..94363ff 100644
--- a/lib/lp/soyuz/browser/queue.py
+++ b/lib/lp/soyuz/browser/queue.py
@@ -118,9 +118,9 @@ class QueueItemsView(LaunchpadView):
         package_upload_builds = upload_set.getBuildByBuildIDs(build_ids)
         package_upload_builds_dict = {}
         for package_upload_build in package_upload_builds:
-            package_upload_builds_dict[
-                package_upload_build.build.id
-            ] = package_upload_build
+            package_upload_builds_dict[package_upload_build.build.id] = (
+                package_upload_build
+            )
         return package_upload_builds_dict
 
     def binary_files_dict(self, package_upload_builds_dict, binary_files):
@@ -447,9 +447,9 @@ class QueueItemsView(LaunchpadView):
             if new_section:
                 feedback_interpolations["section"] = new_section.name
             if new_priority:
-                feedback_interpolations[
-                    "priority"
-                ] = new_priority.title.lower()
+                feedback_interpolations["priority"] = (
+                    new_priority.title.lower()
+                )
 
             try:
                 if action == "accept":
diff --git a/lib/lp/soyuz/browser/tests/archive-views.rst b/lib/lp/soyuz/browser/tests/archive-views.rst
index 19531ca..1bfd909 100644
--- a/lib/lp/soyuz/browser/tests/archive-views.rst
+++ b/lib/lp/soyuz/browser/tests/archive-views.rst
@@ -391,9 +391,9 @@ 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/test_archive_webservice.py b/lib/lp/soyuz/browser/tests/test_archive_webservice.py
index 7599bcf..598a015 100644
--- a/lib/lp/soyuz/browser/tests/test_archive_webservice.py
+++ b/lib/lp/soyuz/browser/tests/test_archive_webservice.py
@@ -254,9 +254,9 @@ class TestSigningKey(TestCaseWithFactory):
             secret_key = gpghandler.importSecretKey(key_file.read())
         public_key = gpghandler.retrieveKey(secret_key.fingerprint)
         public_key_data = public_key.export()
-        removeSecurityProxy(
-            archive
-        ).signing_key_fingerprint = public_key.fingerprint
+        removeSecurityProxy(archive).signing_key_fingerprint = (
+            public_key.fingerprint
+        )
         key_url = gpghandler.getURLForKeyInServer(
             public_key.fingerprint, action="get"
         )
diff --git a/lib/lp/soyuz/browser/tests/test_livefs.py b/lib/lp/soyuz/browser/tests/test_livefs.py
index b2c1194..64c394c 100644
--- a/lib/lp/soyuz/browser/tests/test_livefs.py
+++ b/lib/lp/soyuz/browser/tests/test_livefs.py
@@ -205,9 +205,9 @@ class TestLiveFSAddView(BrowserTestCase):
             self.person, view_name="+new-livefs", user=self.person
         )
         browser.getControl("Name").value = "ubuntu-core"
-        browser.getControl(
-            "Live filesystem build metadata"
-        ).value = '{"product": "ubuntu-core", "image_format": "plain"}'
+        browser.getControl("Live filesystem build metadata").value = (
+            '{"product": "ubuntu-core", "image_format": "plain"}'
+        )
         browser.getControl("Create live filesystem").click()
 
         content = find_main_content(browser.contents)
@@ -349,9 +349,9 @@ class TestLiveFSEditView(BrowserTestCase):
         browser.getControl(name="field.distro_series").value = [
             str(new_series.id)
         ]
-        browser.getControl(
-            "Live filesystem build metadata"
-        ).value = '{"product": "new-name"}'
+        browser.getControl("Live filesystem build metadata").value = (
+            '{"product": "new-name"}'
+        )
         browser.getControl("Update live filesystem").click()
 
         content = find_main_content(browser.contents)
diff --git a/lib/lp/soyuz/doc/archiveauthtoken.rst b/lib/lp/soyuz/doc/archiveauthtoken.rst
index 6b730fb..3fb6508 100644
--- a/lib/lp/soyuz/doc/archiveauthtoken.rst
+++ b/lib/lp/soyuz/doc/archiveauthtoken.rst
@@ -172,9 +172,9 @@ Tokens are only returned if they match a current subscription:
 
     >>> from zope.security.proxy import removeSecurityProxy
     >>> from lp.soyuz.enums import ArchiveSubscriberStatus
-    >>> removeSecurityProxy(
-    ...     subscription_to_joe_private_ppa
-    ... ).status = ArchiveSubscriberStatus.EXPIRED
+    >>> removeSecurityProxy(subscription_to_joe_private_ppa).status = (
+    ...     ArchiveSubscriberStatus.EXPIRED
+    ... )
 
     >>> print(
     ...     token_set.getActiveTokenForArchiveAndPerson(
@@ -189,9 +189,9 @@ Tokens are only returned if they match a current subscription:
     ... )
     None
 
-    >>> removeSecurityProxy(
-    ...     subscription_to_joe_private_ppa
-    ... ).status = ArchiveSubscriberStatus.CURRENT
+    >>> removeSecurityProxy(subscription_to_joe_private_ppa).status = (
+    ...     ArchiveSubscriberStatus.CURRENT
+    ... )
 
 Retrieving tokens works even if the user is subscribed to the archive via
 multiple paths:
diff --git a/lib/lp/soyuz/doc/distroseriesqueue-notify.rst b/lib/lp/soyuz/doc/distroseriesqueue-notify.rst
index da51c36..9f7bb53 100644
--- a/lib/lp/soyuz/doc/distroseriesqueue-notify.rst
+++ b/lib/lp/soyuz/doc/distroseriesqueue-notify.rst
@@ -117,9 +117,9 @@ to the changer.
     ...     "ABCDEF0123456789ABCDDCBA0000111112345678"
     ... )
     >>> removeSecurityProxy(netapplet_upload).signing_key_owner = gpgkey.owner
-    >>> removeSecurityProxy(
-    ...     netapplet_upload
-    ... ).signing_key_fingerprint = gpgkey.fingerprint
+    >>> removeSecurityProxy(netapplet_upload).signing_key_fingerprint = (
+    ...     gpgkey.fingerprint
+    ... )
 
 Now request the email:
 
diff --git a/lib/lp/soyuz/doc/packageupload-lookups.rst b/lib/lp/soyuz/doc/packageupload-lookups.rst
index c673398..dfd20e4 100644
--- a/lib/lp/soyuz/doc/packageupload-lookups.rst
+++ b/lib/lp/soyuz/doc/packageupload-lookups.rst
@@ -152,9 +152,9 @@ as well.
     >>> from zope.security.proxy import removeSecurityProxy
     >>> from lp.soyuz.enums import PackageUploadStatus
     >>> from lp.soyuz.model.queue import PassthroughStatusValue
-    >>> removeSecurityProxy(
-    ...     original_build_upload
-    ... ).status = PassthroughStatusValue(PackageUploadStatus.NEW)
+    >>> removeSecurityProxy(original_build_upload).status = (
+    ...     PassthroughStatusValue(PackageUploadStatus.NEW)
+    ... )
     >>> transaction.commit()
     >>> login(ANONYMOUS)
 
diff --git a/lib/lp/soyuz/doc/publishing.rst b/lib/lp/soyuz/doc/publishing.rst
index a711765..8383383 100644
--- a/lib/lp/soyuz/doc/publishing.rst
+++ b/lib/lp/soyuz/doc/publishing.rst
@@ -791,9 +791,9 @@ ubuntutest series in this test.
 
     >>> from zope.security.proxy import removeSecurityProxy
     >>> breezy_autotest = ppa_source.distroseries
-    >>> removeSecurityProxy(
-    ...     cprov.archive
-    ... ).distribution = breezy_autotest.distribution
+    >>> removeSecurityProxy(cprov.archive).distribution = (
+    ...     breezy_autotest.distribution
+    ... )
     >>> hoary_test = breezy_autotest.distribution.getSeries("hoary-test")
     >>> hoary_test.nominatedarchindep = hoary_test["i386"]
     >>> fake_chroot = test_publisher.addMockFile("fake_chroot.tar.gz")
diff --git a/lib/lp/soyuz/mail/packageupload.py b/lib/lp/soyuz/mail/packageupload.py
index 7d16641..fa2b2e7 100644
--- a/lib/lp/soyuz/mail/packageupload.py
+++ b/lib/lp/soyuz/mail/packageupload.py
@@ -456,9 +456,9 @@ class PackageUploadMailer(BaseMailer):
             and not is_auto_sync_upload(spr, bprs, pocket, announce_from_addr)
         ):
             recipient = AnnouncementStubPerson(distroseries.changeslist)
-            recipients[
-                recipient
-            ] = PackageUploadRecipientReason.forAnnouncement(recipient)
+            recipients[recipient] = (
+                PackageUploadRecipientReason.forAnnouncement(recipient)
+            )
 
         if announce_from_addr is not None:
             announce_from_address = format_address(*announce_from_addr)
diff --git a/lib/lp/soyuz/mail/tests/test_packageupload.py b/lib/lp/soyuz/mail/tests/test_packageupload.py
index 4e5ab2c..23a7685 100644
--- a/lib/lp/soyuz/mail/tests/test_packageupload.py
+++ b/lib/lp/soyuz/mail/tests/test_packageupload.py
@@ -237,9 +237,9 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory):
         # notification is sent.
         bpr = self.factory.makeBinaryPackageRelease()
         changelog = self.factory.makeChangelog(spn="foo", versions=["1.1"])
-        removeSecurityProxy(
-            bpr.build.source_package_release
-        ).changelog = changelog
+        removeSecurityProxy(bpr.build.source_package_release).changelog = (
+            changelog
+        )
         self.layer.txn.commit()
         person = self.factory.makePerson(name="archiver")
         archive = self.factory.makeArchive(owner=person, name="ppa")
diff --git a/lib/lp/soyuz/model/livefs.py b/lib/lp/soyuz/model/livefs.py
index 0412b0e..2ab804f 100644
--- a/lib/lp/soyuz/model/livefs.py
+++ b/lib/lp/soyuz/model/livefs.py
@@ -203,10 +203,14 @@ class LiveFS(StormBase, WebhookTargetMixin):
                 IsDistinctFrom(
                     Cast(LiveFSBuild.metadata_override, "jsonb"),
                     Cast(
-                        None
-                        if metadata_override is None
-                        else six.ensure_text(
-                            json.dumps(metadata_override, ensure_ascii=False)
+                        (
+                            None
+                            if metadata_override is None
+                            else six.ensure_text(
+                                json.dumps(
+                                    metadata_override, ensure_ascii=False
+                                )
+                            )
                         ),
                         "jsonb",
                     ),
diff --git a/lib/lp/soyuz/model/packagecopyjob.py b/lib/lp/soyuz/model/packagecopyjob.py
index 16dd6f2..2776af2 100644
--- a/lib/lp/soyuz/model/packagecopyjob.py
+++ b/lib/lp/soyuz/model/packagecopyjob.py
@@ -297,9 +297,9 @@ class PlainPackageCopyJob(PackageCopyJobDerived):
             "unembargo": unembargo,
             "auto_approve": auto_approve,
             "silent": silent,
-            "source_distroseries": source_distroseries.name
-            if source_distroseries
-            else None,
+            "source_distroseries": (
+                source_distroseries.name if source_distroseries else None
+            ),
             "source_pocket": source_pocket.value if source_pocket else None,
             "phased_update_percentage": phased_update_percentage,
             "move": move,
diff --git a/lib/lp/soyuz/model/queue.py b/lib/lp/soyuz/model/queue.py
index 0d477d7..7c7fda2 100644
--- a/lib/lp/soyuz/model/queue.py
+++ b/lib/lp/soyuz/model/queue.py
@@ -1392,9 +1392,11 @@ class PackageUploadBuild(StormBase):
                 % (
                     binary.binarypackagename.name,
                     binary.version,
-                    "Specific"
-                    if binary.architecturespecific
-                    else "Independent",
+                    (
+                        "Specific"
+                        if binary.architecturespecific
+                        else "Independent"
+                    ),
                 ),
             )
             bins[binary] = (
diff --git a/lib/lp/soyuz/stories/ppa/xx-copy-packages.rst b/lib/lp/soyuz/stories/ppa/xx-copy-packages.rst
index 56f8491..b20a2af 100644
--- a/lib/lp/soyuz/stories/ppa/xx-copy-packages.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-copy-packages.rst
@@ -77,13 +77,13 @@ provided link.
     >>> print(jblack_browser.title)
     Activate PPA : James Blackwell
 
-    >>> jblack_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "PPA for James Blackwell"
+    >>> jblack_browser.getControl(name="field.displayname").value = (
+    ...     "PPA for James Blackwell"
+    ... )
     >>> jblack_browser.getControl(name="field.accepted").value = True
-    >>> jblack_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "There we go ..."
+    >>> jblack_browser.getControl(name="field.description").value = (
+    ...     "There we go ..."
+    ... )
     >>> jblack_browser.getControl("Activate").click()
 
     >>> print(jblack_browser.title)
@@ -599,9 +599,9 @@ James uses the 'delete-packages' interface in his PPA to delete the
     >>> jblack_browser.getControl(name="field.selected_sources").value = [
     ...     pmount_pub_id
     ... ]
-    >>> jblack_browser.getControl(
-    ...     "Deletion comment"
-    ... ).value = "Deleted packages can be copied."
+    >>> jblack_browser.getControl("Deletion comment").value = (
+    ...     "Deleted packages can be copied."
+    ... )
     >>> jblack_browser.getControl("Request Deletion").click()
 
 James return to his PPA packages page and checks that the package is
@@ -709,20 +709,20 @@ together.
 
     >>> jblack_browser.getControl(name="field.name").value = "jblack-friends"
 
-    >>> jblack_browser.getControl(
-    ...     "Display Name"
-    ... ).value = "James Blackwell Friends"
+    >>> jblack_browser.getControl("Display Name").value = (
+    ...     "James Blackwell Friends"
+    ... )
 
     >>> jblack_browser.getControl("Create").click()
 
     >>> jblack_browser.getLink("Create a new PPA").click()
-    >>> jblack_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "PPA for James Blackwell Friends"
+    >>> jblack_browser.getControl(name="field.displayname").value = (
+    ...     "PPA for James Blackwell Friends"
+    ... )
     >>> jblack_browser.getControl(name="field.accepted").value = True
-    >>> jblack_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Come friends ..."
+    >>> jblack_browser.getControl(name="field.description").value = (
+    ...     "Come friends ..."
+    ... )
     >>> jblack_browser.getControl("Activate").click()
 
     >>> print(jblack_browser.title)
@@ -864,20 +864,20 @@ tests.
 
     >>> jblack_browser.getControl(name="field.name").value = "jblack-sandbox"
 
-    >>> jblack_browser.getControl(
-    ...     "Display Name"
-    ... ).value = "James Blackwell Sandbox"
+    >>> jblack_browser.getControl("Display Name").value = (
+    ...     "James Blackwell Sandbox"
+    ... )
 
     >>> jblack_browser.getControl("Create").click()
 
     >>> jblack_browser.getLink("Create a new PPA").click()
-    >>> jblack_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "PPA for James Blackwell Sandbox"
+    >>> jblack_browser.getControl(name="field.displayname").value = (
+    ...     "PPA for James Blackwell Sandbox"
+    ... )
     >>> jblack_browser.getControl(name="field.accepted").value = True
-    >>> jblack_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Come friends ..."
+    >>> jblack_browser.getControl(name="field.description").value = (
+    ...     "Come friends ..."
+    ... )
     >>> jblack_browser.getControl("Activate").click()
 
     >>> print(jblack_browser.title)
@@ -903,9 +903,9 @@ insane because PPA-copy-ui is so cool.
 
     >>> jblack_pub_ids = getPPAPubIDsFor("jblack")
 
-    >>> jblack_browser.getControl(
-    ...     name="field.selected_sources"
-    ... ).value = jblack_pub_ids
+    >>> jblack_browser.getControl(name="field.selected_sources").value = (
+    ...     jblack_pub_ids
+    ... )
 
     >>> jblack_browser.getControl("Destination PPA").value = [
     ...     "~jblack-sandbox/ubuntu/ppa"
diff --git a/lib/lp/soyuz/stories/ppa/xx-delete-packages.rst b/lib/lp/soyuz/stories/ppa/xx-delete-packages.rst
index 9347e8d..08ef6ab 100644
--- a/lib/lp/soyuz/stories/ppa/xx-delete-packages.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-delete-packages.rst
@@ -81,9 +81,9 @@ page via a link:
 The user can update the form to only list published sources with name
 matching the given text.
 
-    >>> admin_browser.getControl(
-    ...     name="field.name_filter"
-    ... ).value = "nonexistentpackage"
+    >>> admin_browser.getControl(name="field.name_filter").value = (
+    ...     "nonexistentpackage"
+    ... )
     >>> admin_browser.getControl("Filter").click()
     >>> print_ppa_packages(admin_browser.contents)
     No matching package for 'nonexistentpackage'.
@@ -153,9 +153,9 @@ entirely readable content.
 
     >>> admin_browser.getControl("Filter").click()
     >>> admin_browser.getControl(name="field.selected_sources").value = ["27"]
-    >>> admin_browser.getControl(
-    ...     "Deletion comment"
-    ... ).value = "DO <where is my XSS ?> IT"
+    >>> admin_browser.getControl("Deletion comment").value = (
+    ...     "DO <where is my XSS ?> IT"
+    ... )
     >>> admin_browser.getControl("Request Deletion").click()
 
     >>> print_feedback_messages(admin_browser.contents)
diff --git a/lib/lp/soyuz/stories/ppa/xx-edit-dependencies.rst b/lib/lp/soyuz/stories/ppa/xx-edit-dependencies.rst
index 9717400..168ca76 100644
--- a/lib/lp/soyuz/stories/ppa/xx-edit-dependencies.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-edit-dependencies.rst
@@ -123,9 +123,9 @@ 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
@@ -136,9 +136,9 @@ 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.
@@ -147,9 +147,9 @@ 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.
@@ -157,9 +157,9 @@ 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
@@ -292,9 +292,9 @@ 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.
@@ -485,9 +485,9 @@ 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
@@ -524,9 +524,9 @@ RELEASE.
     ...     "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)."
@@ -587,9 +587,9 @@ 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"
     ... ]
diff --git a/lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst b/lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst
index 891bb5b..539e741 100644
--- a/lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst
@@ -67,9 +67,9 @@ The PPA breadcrumb follows the PPA displayname.
     ... )
     >>> cprov_browser.open("http://launchpad.test/~cprov/+archive/ubuntu/ppa";)
     >>> cprov_browser.getLink("Change details").click()
-    >>> cprov_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "Default PPA"
+    >>> cprov_browser.getControl(name="field.displayname").value = (
+    ...     "Default PPA"
+    ... )
     >>> cprov_browser.getControl("Save").click()
 
     >>> print_location(cprov_browser.contents)
diff --git a/lib/lp/soyuz/stories/ppa/xx-ppa-packages.rst b/lib/lp/soyuz/stories/ppa/xx-ppa-packages.rst
index 6fe0865..6656375 100644
--- a/lib/lp/soyuz/stories/ppa/xx-ppa-packages.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-ppa-packages.rst
@@ -355,9 +355,9 @@ something to it.
 
     >>> foo_browser = setupBrowser(auth="Basic foo.bar@xxxxxxxxxxxxx:test")
     >>> foo_browser.open("http://launchpad.test/~ubuntu-team/+activate-ppa";)
-    >>> foo_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "PPA for Ubuntu team"
+    >>> foo_browser.getControl(name="field.displayname").value = (
+    ...     "PPA for Ubuntu team"
+    ... )
     >>> foo_browser.getControl(name="field.accepted").value = True
     >>> foo_browser.getControl("Activate").click()
     >>> ubuntu_ppa_url = foo_browser.url
diff --git a/lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.rst b/lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.rst
index b3fb783..7c3d57d 100644
--- a/lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.rst
@@ -62,9 +62,9 @@ The URL template also shows the private URL.
     ...
 
 
-    >>> browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "Private Team PPA"
+    >>> browser.getControl(name="field.displayname").value = (
+    ...     "Private Team PPA"
+    ... )
     >>> browser.getControl(name="field.accepted").value = True
     >>> browser.getControl("Activate").click()
     >>> print(browser.title)
diff --git a/lib/lp/soyuz/stories/ppa/xx-ppa-workflow.rst b/lib/lp/soyuz/stories/ppa/xx-ppa-workflow.rst
index 7e95678..6549034 100644
--- a/lib/lp/soyuz/stories/ppa/xx-ppa-workflow.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-ppa-workflow.rst
@@ -76,9 +76,9 @@ By submitting the form without acknowledging the PPA-ToS results in a
 error with a specific message.
 
     >>> sample_browser.getControl(name="field.name").value = "sampleppa"
-    >>> sample_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "Sample PPA"
+    >>> sample_browser.getControl(name="field.displayname").value = (
+    ...     "Sample PPA"
+    ... )
     >>> sample_browser.getControl("Activate").click()
 
     >>> print_feedback_messages(sample_browser.contents)
@@ -88,9 +88,9 @@ error with a specific message.
 In order to 'activate' a PPA the user must acknowledge the PPA-ToS.
 
     >>> sample_browser.getControl(name="field.accepted").value = True
-    >>> sample_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Hoohay for PPA."
+    >>> sample_browser.getControl(name="field.description").value = (
+    ...     "Hoohay for PPA."
+    ... )
     >>> sample_browser.getControl("Activate").click()
 
 A successful activation redirects to the PPA page
@@ -112,12 +112,12 @@ The PPA owner is able to edit PPA 'displayname' and 'description'.
 
     >>> sample_browser.getLink("Change details").click()
 
-    >>> sample_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "Sample testing PPA"
-    >>> sample_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Howdy, cowboys !"
+    >>> sample_browser.getControl(name="field.displayname").value = (
+    ...     "Sample testing PPA"
+    ... )
+    >>> sample_browser.getControl(name="field.description").value = (
+    ...     "Howdy, cowboys !"
+    ... )
 
     >>> sample_browser.getControl("Save").click()
 
@@ -199,13 +199,13 @@ Let's proceed with the required permissions:
     Activate PPA : ...
 
     >>> sample_browser.getControl(name="field.name").value = "develppa"
-    >>> sample_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "Devel PPA"
+    >>> sample_browser.getControl(name="field.displayname").value = (
+    ...     "Devel PPA"
+    ... )
     >>> sample_browser.getControl(name="field.accepted").value = True
-    >>> sample_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Hoohay for Team PPA."
+    >>> sample_browser.getControl(name="field.description").value = (
+    ...     "Hoohay for Team PPA."
+    ... )
 
 The user is, again, warned about the fact that activating this PPA
 will block renaming of the context team.
@@ -243,9 +243,9 @@ exactly the same as for a user-PPA, see above:
     >>> sample_browser.title
     'Change details : Devel PPA...
 
-    >>> sample_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Yay, I can change it."
+    >>> sample_browser.getControl(name="field.description").value = (
+    ...     "Yay, I can change it."
+    ... )
     >>> sample_browser.getControl("Save").click()
 
     >>> print(sample_browser.title)
@@ -263,9 +263,9 @@ Cancelling the 'Edit' form will redirect the user to the PPA overview
 page and discard the changes.
 
     >>> sample_browser.getLink("Change details").click()
-    >>> sample_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Discarded ..."
+    >>> sample_browser.getControl(name="field.description").value = (
+    ...     "Discarded ..."
+    ... )
     >>> sample_browser.getLink("Cancel").click()
 
     >>> print(sample_browser.title)
@@ -326,9 +326,9 @@ name of other users or teams:
     >>> admin_browser.getControl(name="field.name").value = "ppa"
     >>> admin_browser.getControl(name="field.displayname").value = "Hack PPA"
     >>> admin_browser.getControl(name="field.accepted").value = True
-    >>> admin_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Go for it, you lazy !"
+    >>> admin_browser.getControl(name="field.description").value = (
+    ...     "Go for it, you lazy !"
+    ... )
     >>> admin_browser.getControl("Activate").click()
 
     >>> print(admin_browser.title)
@@ -431,16 +431,16 @@ build on a virtualized builder.
     >>> admin_browser.getControl(
     ...     name="field.suppress_subscription_notifications"
     ... ).value = True
-    >>> admin_browser.getControl(
-    ...     name="field.require_virtualized"
-    ... ).value = True
+    >>> admin_browser.getControl(name="field.require_virtualized").value = (
+    ...     True
+    ... )
     >>> admin_browser.getControl(name="field.authorized_size").value = "1"
-    >>> admin_browser.getControl(
-    ...     name="field.relative_build_score"
-    ... ).value = "199"
-    >>> admin_browser.getControl(
-    ...     name="field.external_dependencies"
-    ... ).value = "deb http://my.spethial.repo.com/ %(series)s main"
+    >>> admin_browser.getControl(name="field.relative_build_score").value = (
+    ...     "199"
+    ... )
+    >>> admin_browser.getControl(name="field.external_dependencies").value = (
+    ...     "deb http://my.spethial.repo.com/ %(series)s main"
+    ... )
     >>> admin_browser.getControl("Save").click()
 
 Once confirmed the administrator is sent to the PPA page where they can
@@ -464,9 +464,9 @@ external dependencies changes that were made:
 The external dependencies field is validated to make sure it looks like
 a sources.list entry.  If the field fails validation an error is displayed.
 
-    >>> admin_browser.getControl(
-    ...     name="field.external_dependencies"
-    ... ).value = "deb not_a_url"
+    >>> admin_browser.getControl(name="field.external_dependencies").value = (
+    ...     "deb not_a_url"
+    ... )
     >>> admin_browser.getControl("Save").click()
     >>> print_feedback_messages(admin_browser.contents)
     There is 1 error.
@@ -544,9 +544,9 @@ user 'Foo Bar'.
     >>> browser2.getControl(name="field.name").value = "boomppa"
     >>> browser2.getControl(name="field.displayname").value = "Boom PPA"
     >>> browser2.getControl(name="field.accepted").value = True
-    >>> browser2.getControl(
-    ...     name="field.description"
-    ... ).value = "PPA does not explode!"
+    >>> browser2.getControl(name="field.description").value = (
+    ...     "PPA does not explode!"
+    ... )
 
 Activate the PPA in the first browser:
 
diff --git a/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.rst b/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.rst
index c7907e1..7f18e96 100644
--- a/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.rst
@@ -70,9 +70,9 @@ subscription expiry, a description of "Joe is my friend" and clicks on the
 "Add subscriber" button,
 
     >>> cprov_browser.getControl(name="field.subscriber").value = "joesmith"
-    >>> cprov_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Joe is my friend"
+    >>> cprov_browser.getControl(name="field.description").value = (
+    ...     "Joe is my friend"
+    ... )
     >>> cprov_browser.getControl(name="field.actions.add").click()
 
 then he is redirected to the subscribers page and the new subscription
@@ -110,12 +110,12 @@ a description of "Launchpad developer access." and clicks on the
     ...     "http://launchpad.test/~cprov/+archive/ubuntu/p3a/+subscriptions";
     ... )
     >>> cprov_browser.getControl(name="field.subscriber").value = "launchpad"
-    >>> cprov_browser.getControl(
-    ...     name="field.date_expires"
-    ... ).value = "2200-08-01"
-    >>> cprov_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Launchpad developer access."
+    >>> cprov_browser.getControl(name="field.date_expires").value = (
+    ...     "2200-08-01"
+    ... )
+    >>> cprov_browser.getControl(name="field.description").value = (
+    ...     "Launchpad developer access."
+    ... )
     >>> cprov_browser.getControl(name="field.actions.add").click()
 
 then Celso is redirected to the subscribers page, the new subscription
@@ -157,9 +157,9 @@ modifies the description field and clicks Update,
     >>> cprov_browser.getLink(
     ...     url="/~cprov/+archive/ubuntu/p3a/+subscriptions/launchpad/+edit",
     ... ).click()
-    >>> cprov_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "a different description"
+    >>> cprov_browser.getControl(name="field.description").value = (
+    ...     "a different description"
+    ... )
     >>> cprov_browser.getControl(name="field.actions.update").click()
 
 then the browser is redirected back to the subscriptions page, the updated
diff --git a/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.rst b/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.rst
index d6290fd..7742a87 100644
--- a/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.rst
@@ -88,17 +88,17 @@ People and teams can be subscribed by entering their details into the
 displayed form:
 
     >>> cprov_browser.getControl(name="field.subscriber").value = "teamjoe"
-    >>> cprov_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Joes friends are my friends"
+    >>> cprov_browser.getControl(name="field.description").value = (
+    ...     "Joes friends are my friends"
+    ... )
     >>> cprov_browser.getControl(name="field.actions.add").click()
     >>> cprov_browser.getControl(name="field.subscriber").value = "bradsmith"
-    >>> cprov_browser.getControl(
-    ...     name="field.date_expires"
-    ... ).value = "2200-08-01"
-    >>> cprov_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Brad can access for a while."
+    >>> cprov_browser.getControl(name="field.date_expires").value = (
+    ...     "2200-08-01"
+    ... )
+    >>> cprov_browser.getControl(name="field.description").value = (
+    ...     "Brad can access for a while."
+    ... )
     >>> cprov_browser.getControl(name="field.actions.add").click()
 
 Once the subscription has been added, it will display in the table:
@@ -138,9 +138,9 @@ so that Joe has multiple subscriptions:
     ...     "http://launchpad.test/~mark/+archive/p3a/+subscriptions";
     ... )
     >>> mark_browser.getControl(name="field.subscriber").value = "joesmith"
-    >>> mark_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Joe is also my friend"
+    >>> mark_browser.getControl(name="field.description").value = (
+    ...     "Joe is also my friend"
+    ... )
     >>> mark_browser.getControl(name="field.actions.add").click()
 
 A person who is subscribed to multiple archives will see all the archives
@@ -201,9 +201,9 @@ has a signing key:
     >>> a_key = getUtility(IGPGKeySet).getByFingerprint(
     ...     "ABCDEF0123456789ABCDDCBA0000111112345678"
     ... )
-    >>> removeSecurityProxy(
-    ...     mark_private_ppa
-    ... ).signing_key_fingerprint = a_key.fingerprint
+    >>> removeSecurityProxy(mark_private_ppa).signing_key_fingerprint = (
+    ...     a_key.fingerprint
+    ... )
     >>> removeSecurityProxy(mark_private_ppa).signing_key_owner = a_key.owner
     >>> logout()
 
@@ -227,9 +227,9 @@ subscriptions page.
     >>> mark_browser.open("http://launchpad.test/~mark/+archive/p3a";)
     >>> mark_browser.getLink("Manage access").click()
     >>> mark_browser.getControl(name="field.subscriber").value = "teamjoe"
-    >>> mark_browser.getControl(
-    ...     name="field.description"
-    ... ).value = "Joe's friends are my friends."
+    >>> mark_browser.getControl(name="field.description").value = (
+    ...     "Joe's friends are my friends."
+    ... )
     >>> mark_browser.getControl(name="field.actions.add").click()
     >>> joe_browser.open(
     ...     "http://launchpad.test/~joesmith/+archivesubscriptions";
diff --git a/lib/lp/soyuz/stories/ppa/xx-private-ppas.rst b/lib/lp/soyuz/stories/ppa/xx-private-ppas.rst
index 72ce5bd..cff12b9 100644
--- a/lib/lp/soyuz/stories/ppa/xx-private-ppas.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-private-ppas.rst
@@ -71,9 +71,9 @@ private.
     >>> admin_browser.open("http://launchpad.test/~landscape-developers";)
 
     >>> admin_browser.getLink("Create a new PPA").click()
-    >>> admin_browser.getControl(
-    ...     name="field.displayname"
-    ... ).value = "PPA for Landscape Developers"
+    >>> admin_browser.getControl(name="field.displayname").value = (
+    ...     "PPA for Landscape Developers"
+    ... )
     >>> admin_browser.getControl(name="field.accepted").value = True
     >>> admin_browser.getControl("Activate").click()
 
diff --git a/lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.rst b/lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.rst
index b48afc9..0ecc303 100644
--- a/lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.rst
@@ -612,9 +612,9 @@ for more information).
     >>> a_key = getUtility(IGPGKeySet).getByFingerprint(
     ...     "ABCDEF0123456789ABCDDCBA0000111112345678"
     ... )
-    >>> removeSecurityProxy(
-    ...     no_priv.archive
-    ... ).signing_key_fingerprint = a_key.fingerprint
+    >>> removeSecurityProxy(no_priv.archive).signing_key_fingerprint = (
+    ...     a_key.fingerprint
+    ... )
     >>> removeSecurityProxy(no_priv.archive).signing_key_owner = a_key.owner
     >>> logout()
 
@@ -672,9 +672,9 @@ Try the same again, but this time using the signing service.
     >>> removeSecurityProxy(no_priv.archive).signing_key_owner = getUtility(
     ...     ILaunchpadCelebrities
     ... ).ppa_key_guard
-    >>> removeSecurityProxy(
-    ...     no_priv.archive
-    ... ).signing_key_fingerprint = signing_key.fingerprint
+    >>> removeSecurityProxy(no_priv.archive).signing_key_fingerprint = (
+    ...     signing_key.fingerprint
+    ... )
     >>> del get_property_cache(no_priv.archive).signing_key
     >>> del get_property_cache(no_priv.archive).signing_key_display_name
     >>> logout()
diff --git a/lib/lp/soyuz/stories/soyuz/xx-build-record.rst b/lib/lp/soyuz/stories/soyuz/xx-build-record.rst
index 593e1c7..2cf5a27 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-build-record.rst
+++ b/lib/lp/soyuz/stories/soyuz/xx-build-record.rst
@@ -533,10 +533,8 @@ If the source package was created from a recipe build, link to it.
     >>> distroseries = factory.makeDistroSeries(
     ...     distribution=cprov.archive.distribution, name="shiny"
     ... )
-    >>> removeSecurityProxy(
-    ...     distroseries
-    ... ).nominatedarchindep = factory.makeDistroArchSeries(
-    ...     distroseries=distroseries
+    >>> removeSecurityProxy(distroseries).nominatedarchindep = (
+    ...     factory.makeDistroArchSeries(distroseries=distroseries)
     ... )
     >>> ppa_source.sourcepackagerelease.source_package_recipe_build = (
     ...     factory.makeSourcePackageRecipeBuild(
diff --git a/lib/lp/soyuz/stories/soyuz/xx-builds-pages.rst b/lib/lp/soyuz/stories/soyuz/xx-builds-pages.rst
index e7ed90b..7e88e51 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-builds-pages.rst
+++ b/lib/lp/soyuz/stories/soyuz/xx-builds-pages.rst
@@ -553,9 +553,9 @@ Such feature is visible when anonymous user access the
     >>> from zope.security.proxy import removeSecurityProxy
     >>> from lp.soyuz.enums import PackageUploadStatus
     >>> from lp.soyuz.model.queue import PassthroughStatusValue
-    >>> removeSecurityProxy(
-    ...     build_i386.package_upload
-    ... ).status = PassthroughStatusValue(PackageUploadStatus.UNAPPROVED)
+    >>> removeSecurityProxy(build_i386.package_upload).status = (
+    ...     PassthroughStatusValue(PackageUploadStatus.UNAPPROVED)
+    ... )
     >>> transaction.commit()
     >>> logout()
 
diff --git a/lib/lp/soyuz/stories/soyuz/xx-distribution-add.rst b/lib/lp/soyuz/stories/soyuz/xx-distribution-add.rst
index 081c861..a5546ee 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-distribution-add.rst
+++ b/lib/lp/soyuz/stories/soyuz/xx-distribution-add.rst
@@ -32,9 +32,9 @@ Create a Test distribution:
     >>> admin_browser.getControl(name="field.name").value = "test"
     >>> admin_browser.getControl("Display Name").value = "Test Distro"
     >>> admin_browser.getControl("Summary").value = "Test Distro Summary"
-    >>> admin_browser.getControl(
-    ...     "Description"
-    ... ).value = "Test Distro Description"
+    >>> admin_browser.getControl("Description").value = (
+    ...     "Test Distro Description"
+    ... )
     >>> admin_browser.getControl("Web site URL").value = "foo.com"
     >>> admin_browser.getControl("Members").value = "mark"
 
diff --git a/lib/lp/soyuz/stories/soyuz/xx-distribution-edit.rst b/lib/lp/soyuz/stories/soyuz/xx-distribution-edit.rst
index ff23e08..d22fda9 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-distribution-edit.rst
+++ b/lib/lp/soyuz/stories/soyuz/xx-distribution-edit.rst
@@ -13,9 +13,9 @@ Change some details of the Ubuntu distribution that were incorrect.
     >>> admin_browser.getControl("Display Name").value = "Test Distro"
 
     >>> admin_browser.getControl("Summary").value = "Test Distro Summary"
-    >>> admin_browser.getControl(
-    ...     "Description"
-    ... ).value = "Test Distro Description"
+    >>> admin_browser.getControl("Description").value = (
+    ...     "Test Distro Description"
+    ... )
 
     >>> admin_browser.getControl("Change", index=3).click()
     >>> admin_browser.url
diff --git a/lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.rst b/lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.rst
index c333fbb..44dcb05 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.rst
+++ b/lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.rst
@@ -251,9 +251,9 @@ Any user can see the copyright for the most recent source package release.
     ...     "mozilla-firefox"
     ... )
     >>> source_package_release = warty_firefox.distinctreleases[0]
-    >>> removeSecurityProxy(
-    ...     source_package_release
-    ... ).copyright = "Copyright 2010 Ford Prefect."
+    >>> removeSecurityProxy(source_package_release).copyright = (
+    ...     "Copyright 2010 Ford Prefect."
+    ... )
     >>> transaction.commit()
     >>> logout()
 
diff --git a/lib/lp/soyuz/stories/soyuz/xx-queue-pages.rst b/lib/lp/soyuz/stories/soyuz/xx-queue-pages.rst
index 7d0d3dc..3d31309 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-queue-pages.rst
+++ b/lib/lp/soyuz/stories/soyuz/xx-queue-pages.rst
@@ -328,9 +328,9 @@ Upload a new "bar" source so we can accept it later.
 
     >>> from lp.soyuz.enums import PackageUploadStatus
     >>> from lp.soyuz.model.queue import PassthroughStatusValue
-    >>> removeSecurityProxy(
-    ...     bar_src.package_upload
-    ... ).status = PassthroughStatusValue(PackageUploadStatus.NEW)
+    >>> removeSecurityProxy(bar_src.package_upload).status = (
+    ...     PassthroughStatusValue(PackageUploadStatus.NEW)
+    ... )
     >>> bar_queue_id = bar_src.package_upload.id
 
 Swallow any email generated at the upload:
@@ -588,9 +588,9 @@ Rejecting 'alsa-utils' source:
     >>> upload_manager_browser.getControl(name="QUEUE_ID").value = ["4"]
     >>> upload_manager_browser.getControl(name="Reject").disabled
     False
-    >>> upload_manager_browser.getControl(
-    ...     name="rejection_comment"
-    ... ).value = "Foo"
+    >>> upload_manager_browser.getControl(name="rejection_comment").value = (
+    ...     "Foo"
+    ... )
     >>> upload_manager_browser.getControl(name="Reject").click()
     >>> print_feedback_messages(upload_manager_browser.contents)
     OK: alsa-utils
diff --git a/lib/lp/soyuz/stories/webservice/xx-archive.rst b/lib/lp/soyuz/stories/webservice/xx-archive.rst
index b53d7d3..b308252 100644
--- a/lib/lp/soyuz/stories/webservice/xx-archive.rst
+++ b/lib/lp/soyuz/stories/webservice/xx-archive.rst
@@ -92,9 +92,9 @@ We can quickly assign a random OpenPGP key to Celso's PPA.
     ABCDEF0123456789ABCDDCBA0000111112345678
 
     >>> cprov = getUtility(IPersonSet).getByName("cprov")
-    >>> removeSecurityProxy(
-    ...     cprov.archive
-    ... ).signing_key_fingerprint = a_key.fingerprint
+    >>> removeSecurityProxy(cprov.archive).signing_key_fingerprint = (
+    ...     a_key.fingerprint
+    ... )
     >>> removeSecurityProxy(cprov.archive).signing_key_owner = a_key.owner
     >>> print(cprov.archive.signing_key_fingerprint)
     ABCDEF0123456789ABCDDCBA0000111112345678
diff --git a/lib/lp/soyuz/tests/test_archive.py b/lib/lp/soyuz/tests/test_archive.py
index 0456d75..3d416ac 100644
--- a/lib/lp/soyuz/tests/test_archive.py
+++ b/lib/lp/soyuz/tests/test_archive.py
@@ -4421,9 +4421,9 @@ class TestCopyPackage(TestCaseWithFactory):
         )
         with person_logged_in(target_archive.owner):
             target_archive.newComponentUploader(source_archive.owner, "main")
-        removeSecurityProxy(
-            source.distroseries
-        ).status = SeriesStatus.SUPPORTED
+        removeSecurityProxy(source.distroseries).status = (
+            SeriesStatus.SUPPORTED
+        )
         with person_logged_in(source_archive.owner):
             expected_error = "Cannot delete publications from suite '%s'" % (
                 source.distroseries.getSuite(source.pocket)
@@ -4932,9 +4932,9 @@ class TestCopyPackage(TestCaseWithFactory):
         )
         with person_logged_in(target_archive.owner):
             target_archive.newComponentUploader(source_archive.owner, "main")
-        removeSecurityProxy(
-            source.distroseries
-        ).status = SeriesStatus.SUPPORTED
+        removeSecurityProxy(source.distroseries).status = (
+            SeriesStatus.SUPPORTED
+        )
         with person_logged_in(source_archive.owner):
             expected_error = "Cannot delete publications from suite '%s'" % (
                 source.distroseries.getSuite(source.pocket)
@@ -6020,9 +6020,9 @@ class TestSigningKeyPropagation(TestCaseWithFactory):
         self.factory.makeGPGKey(person)
         key = person.gpg_keys[0]
         removeSecurityProxy(person.archive).signing_key_owner = key.owner
-        removeSecurityProxy(
-            person.archive
-        ).signing_key_fingerprint = key.fingerprint
+        removeSecurityProxy(person.archive).signing_key_fingerprint = (
+            key.fingerprint
+        )
         del get_property_cache(person.archive).signing_key
         ppa_with_key = self.factory.makeArchive(
             owner=person, purpose=ArchivePurpose.PPA
@@ -6055,9 +6055,9 @@ class TestGetSigningKeyData(TestCaseWithFactory):
             secret_key = gpghandler.importSecretKey(key_file.read())
         public_key = gpghandler.retrieveKey(secret_key.fingerprint)
         public_key_data = public_key.export()
-        removeSecurityProxy(
-            ppa
-        ).signing_key_fingerprint = public_key.fingerprint
+        removeSecurityProxy(ppa).signing_key_fingerprint = (
+            public_key.fingerprint
+        )
         key_url = gpghandler.getURLForKeyInServer(
             public_key.fingerprint, action="get"
         )
@@ -6216,10 +6216,10 @@ class TestArchiveGetOverridePolicy(TestCaseWithFactory):
         super().setUp()
         self.series = self.factory.makeDistroSeries()
         with admin_logged_in():
-            self.series.nominatedarchindep = (
-                self.amd64
-            ) = self.factory.makeDistroArchSeries(
-                distroseries=self.series, architecturetag="amd64"
+            self.series.nominatedarchindep = self.amd64 = (
+                self.factory.makeDistroArchSeries(
+                    distroseries=self.series, architecturetag="amd64"
+                )
             )
             self.armhf = self.factory.makeDistroArchSeries(
                 distroseries=self.series, architecturetag="armhf"
diff --git a/lib/lp/soyuz/tests/test_archive_subscriptions.py b/lib/lp/soyuz/tests/test_archive_subscriptions.py
index b815a3d..5f64d39 100644
--- a/lib/lp/soyuz/tests/test_archive_subscriptions.py
+++ b/lib/lp/soyuz/tests/test_archive_subscriptions.py
@@ -202,9 +202,11 @@ class PersonArchiveSubscriptions(TestCaseWithFactory):
             # some archives are owned by a user, others are owned by a team
             archive = self.factory.makeArchive(
                 private=True,
-                owner=archive_owner
-                if x < 5
-                else self.factory.makeTeam(members=[archive_owner]),
+                owner=(
+                    archive_owner
+                    if x < 5
+                    else self.factory.makeTeam(members=[archive_owner])
+                ),
             )
             with person_logged_in(archive.owner):
                 if x >= 5:
diff --git a/lib/lp/soyuz/tests/test_archivefile.py b/lib/lp/soyuz/tests/test_archivefile.py
index 23b2f49..c6f1ebf 100644
--- a/lib/lp/soyuz/tests/test_archivefile.py
+++ b/lib/lp/soyuz/tests/test_archivefile.py
@@ -318,18 +318,18 @@ class TestArchiveFile(TestCaseWithFactory):
             )
         )
         now = get_transaction_timestamp(Store.of(archive_files[0]))
-        removeSecurityProxy(
-            archive_files[0]
-        ).scheduled_deletion_date = now - timedelta(days=1)
-        removeSecurityProxy(
-            archive_files[1]
-        ).scheduled_deletion_date = now - timedelta(days=1)
-        removeSecurityProxy(
-            archive_files[2]
-        ).scheduled_deletion_date = now + timedelta(days=1)
-        removeSecurityProxy(
-            archive_files[6]
-        ).scheduled_deletion_date = now - timedelta(days=1)
+        removeSecurityProxy(archive_files[0]).scheduled_deletion_date = (
+            now - timedelta(days=1)
+        )
+        removeSecurityProxy(archive_files[1]).scheduled_deletion_date = (
+            now - timedelta(days=1)
+        )
+        removeSecurityProxy(archive_files[2]).scheduled_deletion_date = (
+            now + timedelta(days=1)
+        )
+        removeSecurityProxy(archive_files[6]).scheduled_deletion_date = (
+            now - timedelta(days=1)
+        )
         archive_file_set = getUtility(IArchiveFileSet)
         self.assertContentEqual(
             ["release:foo"], archive_file_set.getContainersToReap(archive)
@@ -337,9 +337,9 @@ class TestArchiveFile(TestCaseWithFactory):
         self.assertContentEqual(
             ["baz"], archive_file_set.getContainersToReap(other_archive)
         )
-        removeSecurityProxy(
-            archive_files[3]
-        ).scheduled_deletion_date = now - timedelta(days=1)
+        removeSecurityProxy(archive_files[3]).scheduled_deletion_date = (
+            now - timedelta(days=1)
+        )
         self.assertContentEqual(
             ["release:foo", "other:bar"],
             archive_file_set.getContainersToReap(archive),
diff --git a/lib/lp/soyuz/tests/test_build_start_estimation.py b/lib/lp/soyuz/tests/test_build_start_estimation.py
index 4146664..3ad8fa2 100644
--- a/lib/lp/soyuz/tests/test_build_start_estimation.py
+++ b/lib/lp/soyuz/tests/test_build_start_estimation.py
@@ -57,9 +57,9 @@ class TestBuildStartEstimation(TestCaseWithFactory):
         [build1] = pkg1.createMissingBuilds()
         build1.buildqueue_record.lastscore = 1000
         # No user-serviceable parts inside
-        removeSecurityProxy(
-            build1.buildqueue_record
-        ).estimated_duration = timedelta(minutes=10)
+        removeSecurityProxy(build1.buildqueue_record).estimated_duration = (
+            timedelta(minutes=10)
+        )
         pkg2 = self.publisher.getPubSource(
             sourcename=self.factory.getUniqueString(),
             distroseries=self.distroseries,
diff --git a/lib/lp/soyuz/tests/test_packagecopyjob.py b/lib/lp/soyuz/tests/test_packagecopyjob.py
index e414e11..26fdd08 100644
--- a/lib/lp/soyuz/tests/test_packagecopyjob.py
+++ b/lib/lp/soyuz/tests/test_packagecopyjob.py
@@ -1987,9 +1987,9 @@ class PlainPackageCopyJobTests(TestCaseWithFactory, LocalTestHelper):
 
         # If the dsd differs only in parent series, that's enough to
         # make it a non-match.
-        removeSecurityProxy(
-            dsd
-        ).parent_series = self.factory.makeDistroSeries()
+        removeSecurityProxy(dsd).parent_series = (
+            self.factory.makeDistroSeries()
+        )
 
         self.assertContentEqual([], naked_job.findMatchingDSDs())
 
diff --git a/lib/lp/testing/factory.py b/lib/lp/testing/factory.py
index 841baea..61e4f6e 100644
--- a/lib/lp/testing/factory.py
+++ b/lib/lp/testing/factory.py
@@ -694,9 +694,9 @@ class LaunchpadObjectFactory(ObjectFactory):
         )
         if account_status:
             if account_status in once_active:
-                removeSecurityProxy(
-                    person.account
-                ).status = AccountStatus.ACTIVE
+                removeSecurityProxy(person.account).status = (
+                    AccountStatus.ACTIVE
+                )
             removeSecurityProxy(person.account).status = account_status
         self.makeOpenIdIdentifier(person.account)
 
@@ -3816,9 +3816,9 @@ class LaunchpadObjectFactory(ObjectFactory):
         if date_superseded is not None:
             removeSecurityProxy(archive_file).date_superseded = date_superseded
         if scheduled_deletion_date is not None:
-            removeSecurityProxy(
-                archive_file
-            ).scheduled_deletion_date = scheduled_deletion_date
+            removeSecurityProxy(archive_file).scheduled_deletion_date = (
+                scheduled_deletion_date
+            )
         if date_removed is not None:
             removeSecurityProxy(archive_file).date_removed = date_removed
         return archive_file
@@ -5243,9 +5243,9 @@ class LaunchpadObjectFactory(ObjectFactory):
                 with_file=with_file,
                 creator=creator,
             )
-            removeSecurityProxy(
-                bpph.binarypackagerelease
-            ).debug_package = debug_bpph.binarypackagerelease
+            removeSecurityProxy(bpph.binarypackagerelease).debug_package = (
+                debug_bpph.binarypackagerelease
+            )
             return bpphs[0], debug_bpph
         return bpphs[0]
 
diff --git a/lib/lp/translations/browser/tests/test_translationmessage_view.py b/lib/lp/translations/browser/tests/test_translationmessage_view.py
index 6c4b0c8..92f1c0d 100644
--- a/lib/lp/translations/browser/tests/test_translationmessage_view.py
+++ b/lib/lp/translations/browser/tests/test_translationmessage_view.py
@@ -495,9 +495,9 @@ class TestCurrentTranslationMessagePageView(TestCaseWithFactory):
         # Users who have declined the relicensing agreement can't post
         # translations.
         decliner = self.factory.makePerson()
-        ITranslationsPerson(
-            decliner
-        ).translations_relicensing_agreement = False
+        ITranslationsPerson(decliner).translations_relicensing_agreement = (
+            False
+        )
         with person_logged_in(decliner):
             view = self._makeView()
             self.assertRaises(UnexpectedFormData, view._checkSubmitConditions)
diff --git a/lib/lp/translations/browser/tests/test_translationtemplatesbuild.py b/lib/lp/translations/browser/tests/test_translationtemplatesbuild.py
index e437b45..cbfc89e 100644
--- a/lib/lp/translations/browser/tests/test_translationtemplatesbuild.py
+++ b/lib/lp/translations/browser/tests/test_translationtemplatesbuild.py
@@ -50,9 +50,7 @@ class TestTranslationTemplatesBuild(TestCaseWithFactory):
         """Create a `ProductSeries` that imports templates from `branch`."""
         productseries = self.factory.makeProductSeries()
         removeSecurityProxy(productseries).branch = branch
-        removeSecurityProxy(
-            productseries
-        ).translations_autoimport_mode = (
+        removeSecurityProxy(productseries).translations_autoimport_mode = (
             TranslationsBranchImportMode.IMPORT_TEMPLATES
         )
         return productseries
diff --git a/lib/lp/translations/browser/translationimportqueue.py b/lib/lp/translations/browser/translationimportqueue.py
index 41d2bf1..b31c8c7 100644
--- a/lib/lp/translations/browser/translationimportqueue.py
+++ b/lib/lp/translations/browser/translationimportqueue.py
@@ -128,9 +128,9 @@ class TranslationImportQueueEntryView(LaunchpadFormView):
                 # languagepacks.
                 field_values["languagepack"] = True
             else:
-                field_values[
-                    "languagepack"
-                ] = self.context.potemplate.languagepack
+                field_values["languagepack"] = (
+                    self.context.potemplate.languagepack
+                )
         if file_type in (TranslationFileType.POT, TranslationFileType.UNSPEC):
             potemplate = self.context.potemplate
             if potemplate is None:
@@ -139,9 +139,9 @@ class TranslationImportQueueEntryView(LaunchpadFormView):
                 field_values["translation_domain"] = domain
             else:
                 field_values["name"] = potemplate.name
-                field_values[
-                    "translation_domain"
-                ] = potemplate.translation_domain
+                field_values["translation_domain"] = (
+                    potemplate.translation_domain
+                )
         if file_type in (TranslationFileType.PO, TranslationFileType.UNSPEC):
             field_values["potemplate"] = self.context.potemplate
             if self.context.pofile is not None:
diff --git a/lib/lp/translations/model/potmsgset.py b/lib/lp/translations/model/potmsgset.py
index e4efa9e..4b11735 100644
--- a/lib/lp/translations/model/potmsgset.py
+++ b/lib/lp/translations/model/potmsgset.py
@@ -584,9 +584,9 @@ class POTMsgSet(StormBase):
             translation = translations.get(pluralform)
             if translation is not None:
                 # Find or create a POTranslation for the specified text
-                potranslations[
-                    pluralform
-                ] = POTranslation.getOrCreateTranslation(translation)
+                potranslations[pluralform] = (
+                    POTranslation.getOrCreateTranslation(translation)
+                )
             else:
                 potranslations[pluralform] = None
         return potranslations
diff --git a/lib/lp/translations/scripts/tests/test_remove_translations.py b/lib/lp/translations/scripts/tests/test_remove_translations.py
index dbea556..2f66f7f 100644
--- a/lib/lp/translations/scripts/tests/test_remove_translations.py
+++ b/lib/lp/translations/scripts/tests/test_remove_translations.py
@@ -668,12 +668,12 @@ class TestRemoveTranslations(TestCase):
         (new_nl_message, new_de_message) = self._makeMessages(
             "new", "nieuw", "neu", is_current_upstream=True
         )
-        removeSecurityProxy(
-            new_nl_message
-        ).origin = RosettaTranslationOrigin.SCM
-        removeSecurityProxy(
-            new_de_message
-        ).origin = RosettaTranslationOrigin.SCM
+        removeSecurityProxy(new_nl_message).origin = (
+            RosettaTranslationOrigin.SCM
+        )
+        removeSecurityProxy(new_de_message).origin = (
+            RosettaTranslationOrigin.SCM
+        )
 
         self._removeMessages(
             potemplate=self.potemplate.id, origin=RosettaTranslationOrigin.SCM
diff --git a/lib/lp/translations/scripts/tests/test_reupload_translations.py b/lib/lp/translations/scripts/tests/test_reupload_translations.py
index bb1cdf5..d6ccda6 100644
--- a/lib/lp/translations/scripts/tests/test_reupload_translations.py
+++ b/lib/lp/translations/scripts/tests/test_reupload_translations.py
@@ -41,9 +41,9 @@ class UploadInjector:
 
     def __call__(self, name):
         package = self.original_findPackage(name)
-        removeSecurityProxy(
-            package
-        ).getLatestTranslationsUploads = self._fakeTranslationsUpload
+        removeSecurityProxy(package).getLatestTranslationsUploads = (
+            self._fakeTranslationsUpload
+        )
         return package
 
     def _fakeTranslationsUpload(self):
diff --git a/lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.rst b/lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.rst
index a01ca56..c66a7cc 100644
--- a/lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.rst
+++ b/lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.rst
@@ -33,9 +33,9 @@ Current value is empty.
 
 And the admin is able to set it.
 
-    >>> browser.getControl(
-    ...     "Language Pack Administrator"
-    ... ).value = "martin.pitt@xxxxxxxxxxxxx"
+    >>> browser.getControl("Language Pack Administrator").value = (
+    ...     "martin.pitt@xxxxxxxxxxxxx"
+    ... )
     >>> browser.getControl("Change").click()
     >>> print(browser.url)
     http://translations.launchpad.test/ubuntu/+select-language-pack-admin
diff --git a/lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.rst b/lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.rst
index 9b4833f..10a48f6 100644
--- a/lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.rst
+++ b/lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.rst
@@ -50,9 +50,9 @@ Now somebody else comes and makes a really bad suggestion.
     >>> user_browser.getControl(
     ...     name="msgset_198_de_translation_0_radiobutton"
     ... ).value = ["msgset_198_de_translation_0_new"]
-    >>> user_browser.getControl(
-    ...     name="msgset_198_de_needsreview"
-    ... ).value = "force_suggestion"
+    >>> user_browser.getControl(name="msgset_198_de_needsreview").value = (
+    ...     "force_suggestion"
+    ... )
     >>> user_browser.getControl("Save & Continue").click()
     >>> print(user_browser.url)
     http://translations.../alsa-utils/trunk/+pots/alsa-utils/de/+translate
@@ -85,9 +85,9 @@ translation and to dismiss all suggestions.
     ...     "http://translations.launchpad.test/alsa-utils";
     ...     "/trunk/+pots/alsa-utils/de/+translate"
     ... )
-    >>> admin_browser.getControl(
-    ...     name="msgset_198_dismiss"
-    ... ).value = "dismiss_suggestions"
+    >>> admin_browser.getControl(name="msgset_198_dismiss").value = (
+    ...     "dismiss_suggestions"
+    ... )
     >>> admin_browser.getControl("Save & Continue").click()
     >>> print(admin_browser.url)
     http://translations.../alsa-utils/trunk/+pots/alsa-utils/de/+translate
@@ -122,9 +122,9 @@ such a case.
     ...     "http://translations.launchpad.test/evolution/";
     ...     "trunk/+pots/evolution-2.2/es/5/+translate"
     ... )
-    >>> admin_browser.getControl(
-    ...     name="msgset_5_dismiss"
-    ... ).value = "dismiss_suggestions"
+    >>> admin_browser.getControl(name="msgset_5_dismiss").value = (
+    ...     "dismiss_suggestions"
+    ... )
     >>> admin_browser.getControl("Save & Continue").click()
     >>> print(admin_browser.url)
     http://translations.../evolution/trunk/+pots/evolution-2.2/es/6/+translate
diff --git a/lib/lp/translations/stories/standalone/xx-pofile-translate-gettext-error-middle-page.rst b/lib/lp/translations/stories/standalone/xx-pofile-translate-gettext-error-middle-page.rst
index 2470e8c..7133a8c 100644
--- a/lib/lp/translations/stories/standalone/xx-pofile-translate-gettext-error-middle-page.rst
+++ b/lib/lp/translations/stories/standalone/xx-pofile-translate-gettext-error-middle-page.rst
@@ -15,9 +15,9 @@ integer.
     >>> browser.getControl(
     ...     name="msgset_142_es_translation_0_radiobutton"
     ... ).value = ["msgset_142_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_142_es_translation_0_new"
-    ... ).value = b"Migrando \xc2\xab%i\xc2\xbb"
+    >>> browser.getControl(name="msgset_142_es_translation_0_new").value = (
+    ...     b"Migrando \xc2\xab%i\xc2\xbb"
+    ... )
 
 We are going to add a valid translation too so we are sure that it's stored
 even when there is an error in another message of the same form.
@@ -25,9 +25,9 @@ even when there is an error in another message of the same form.
     >>> browser.getControl(
     ...     name="msgset_140_es_translation_0_radiobutton"
     ... ).value = ["msgset_140_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_140_es_translation_0_new"
-    ... ).value = "Foo"
+    >>> browser.getControl(name="msgset_140_es_translation_0_new").value = (
+    ...     "Foo"
+    ... )
 
 And submit the form.
 
diff --git a/lib/lp/translations/stories/standalone/xx-pofile-translate-newlines-check.rst b/lib/lp/translations/stories/standalone/xx-pofile-translate-newlines-check.rst
index 4df1077..2670593 100644
--- a/lib/lp/translations/stories/standalone/xx-pofile-translate-newlines-check.rst
+++ b/lib/lp/translations/stories/standalone/xx-pofile-translate-newlines-check.rst
@@ -45,9 +45,9 @@ answer should have exactly those strings.
     >>> browser.getControl(
     ...     name="msgset_149_es_translation_0_radiobutton"
     ... ).value = ["msgset_149_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_149_es_translation_0_new"
-    ... ).value = "\r\nfoo\r\n\r\n"
+    >>> browser.getControl(name="msgset_149_es_translation_0_new").value = (
+    ...     "\r\nfoo\r\n\r\n"
+    ... )
     >>> browser.getControl(name="submit_translations").click()
     >>> print(browser.url)  # noqa
     http://translations.launchpad.test/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/es/+translate?start=19&batch=1
@@ -69,9 +69,9 @@ change the test, to be 100% sure that the textarea content is the right one.
     >>> browser.getControl(
     ...     name="msgset_149_es_translation_0_radiobutton"
     ... ).value = ["msgset_149_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_149_es_translation_0_new"
-    ... ).value = "foo"
+    >>> browser.getControl(name="msgset_149_es_translation_0_new").value = (
+    ...     "foo"
+    ... )
     >>> browser.getControl(name="submit_translations").click()
     >>> print(browser.url)  # noqa
     http://translations.launchpad.test/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/es/+translate?start=19&batch=1
@@ -94,9 +94,9 @@ Launchpad adds it automatically.
     >>> browser.getControl(
     ...     name="msgset_165_es_translation_0_radiobutton"
     ... ).value = ["msgset_165_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_165_es_translation_0_new"
-    ... ).value = b"%s: la opcion \xc2\xab%s\xc2\xbb es ambigua"
+    >>> browser.getControl(name="msgset_165_es_translation_0_new").value = (
+    ...     b"%s: la opcion \xc2\xab%s\xc2\xbb es ambigua"
+    ... )
     >>> browser.getControl(name="submit_translations").click()
 
 We were redirected to the next form, the translation was accepted.
@@ -132,9 +132,9 @@ Now, we do the right submit, with one trailing new line...
     >>> browser.getControl(
     ...     name="msgset_165_es_translation_0_radiobutton"
     ... ).value = ["msgset_165_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_165_es_translation_0_new"
-    ... ).value = b"%s: la opcion \xc2\xab%s\xc2\xbb es ambigua\r\n"
+    >>> browser.getControl(name="msgset_165_es_translation_0_new").value = (
+    ...     b"%s: la opcion \xc2\xab%s\xc2\xbb es ambigua\r\n"
+    ... )
     >>> browser.getControl(name="submit_translations").click()
 
 We were redirected to the next form, the translation was accepted.
@@ -170,9 +170,9 @@ Last check, the user sends two new line chars instead of just one...
     >>> browser.getControl(
     ...     name="msgset_165_es_translation_0_radiobutton"
     ... ).value = ["msgset_165_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_165_es_translation_0_new"
-    ... ).value = b"%s: la opcion \xc2\xab%s\xc2\xbb es ambigua\r\n\r\n"
+    >>> browser.getControl(name="msgset_165_es_translation_0_new").value = (
+    ...     b"%s: la opcion \xc2\xab%s\xc2\xbb es ambigua\r\n\r\n"
+    ... )
     >>> browser.getControl(name="submit_translations").click()
 
 We were redirected to the next form, the translation was accepted.
diff --git a/lib/lp/translations/stories/standalone/xx-potemplate-admin.rst b/lib/lp/translations/stories/standalone/xx-potemplate-admin.rst
index 4cea87d..2b8d9ad 100644
--- a/lib/lp/translations/stories/standalone/xx-potemplate-admin.rst
+++ b/lib/lp/translations/stories/standalone/xx-potemplate-admin.rst
@@ -159,9 +159,9 @@ above.
 
 And now let's get back to renaming.
 
-    >>> admin_browser.getControl(
-    ...     name="field.name"
-    ... ).value = "evolution-renamed"
+    >>> admin_browser.getControl(name="field.name").value = (
+    ...     "evolution-renamed"
+    ... )
     >>> admin_browser.getControl("Change").click()
     >>> print(admin_browser.url)
     http://translations.launchpad.test/evolution/trunk/+pots/evolution-renamed
diff --git a/lib/lp/translations/stories/standalone/xx-translationmessage-translate.rst b/lib/lp/translations/stories/standalone/xx-translationmessage-translate.rst
index 75b503f..aa0eb7d 100644
--- a/lib/lp/translations/stories/standalone/xx-translationmessage-translate.rst
+++ b/lib/lp/translations/stories/standalone/xx-translationmessage-translate.rst
@@ -234,9 +234,9 @@ Let's submit an invalid value for this message #13.
     >>> browser.getControl(
     ...     name="msgset_142_es_translation_0_radiobutton"
     ... ).value = ["msgset_142_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_142_es_translation_0_new"
-    ... ).value = "foo %i"
+    >>> browser.getControl(name="msgset_142_es_translation_0_new").value = (
+    ...     "foo %i"
+    ... )
     >>> browser.getControl(name="submit_translations").click()
     >>> print(browser.url)
     http://.../hoary/+source/evolution/+pots/evolution-2.2/es/13/+translate
@@ -286,9 +286,9 @@ And now a good submit.
     >>> browser.getControl(
     ...     name="msgset_142_es_translation_0_radiobutton"
     ... ).value = ["msgset_142_es_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_142_es_translation_0_new"
-    ... ).value = "foo %s"
+    >>> browser.getControl(name="msgset_142_es_translation_0_new").value = (
+    ...     "foo %s"
+    ... )
     >>> browser.getControl(name="submit_translations").click()
 
 We moved to the next message, that means this submission worked.
@@ -570,9 +570,9 @@ We can change a translation for messages with context.
     >>> browser.getControl(
     ...     name="msgset_198_sr_translation_0_radiobutton"
     ... ).value = ["msgset_198_sr_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_198_sr_translation_0_new"
-    ... ).value = "blah"
+    >>> browser.getControl(name="msgset_198_sr_translation_0_new").value = (
+    ...     "blah"
+    ... )
 
 And submit it.
 
diff --git a/lib/lp/translations/stories/translationgroups/xx-link-to-documentation.rst b/lib/lp/translations/stories/translationgroups/xx-link-to-documentation.rst
index 9c4ef20..94e145b 100644
--- a/lib/lp/translations/stories/translationgroups/xx-link-to-documentation.rst
+++ b/lib/lp/translations/stories/translationgroups/xx-link-to-documentation.rst
@@ -24,9 +24,9 @@ translators.
 
 This way he can also set the documentation URL.
 
-    >>> carlos_browser.getControl(
-    ...     "Translation guidelines"
-    ... ).value = "http://www.ubuntu.com/";
+    >>> carlos_browser.getControl("Translation guidelines").value = (
+    ...     "http://www.ubuntu.com/";
+    ... )
     >>> carlos_browser.getControl("Change").click()
     >>> print(carlos_browser.url)
     http://translations.launchpad.test/+groups/testing-translation-team
@@ -88,9 +88,9 @@ the documentation url through the edit view.
     >>> print(test_browser.title)
     Set Esperanto guidelines...
 
-    >>> test_browser.getControl(
-    ...     "Translation guidelines"
-    ... ).value = "http://www.launchpad.net/";
+    >>> test_browser.getControl("Translation guidelines").value = (
+    ...     "http://www.launchpad.net/";
+    ... )
     >>> test_browser.getControl("Set guidelines").click()
     >>> print(test_browser.url)
     http://translations.launchpad.test/~name12
diff --git a/lib/lp/translations/stories/translationgroups/xx-translationgroups.rst b/lib/lp/translations/stories/translationgroups/xx-translationgroups.rst
index c4f2053..b0074d9 100644
--- a/lib/lp/translations/stories/translationgroups/xx-translationgroups.rst
+++ b/lib/lp/translations/stories/translationgroups/xx-translationgroups.rst
@@ -44,9 +44,9 @@ Translation group names must meet certain conditions.  For example, they
 may not contain any upper-case letters.
 
     >>> admin_browser.getControl("Name").value = "PolYglot"
-    >>> admin_browser.getControl(
-    ...     "Title"
-    ... ).value = "The PolyGlot Translation Group"
+    >>> admin_browser.getControl("Title").value = (
+    ...     "The PolyGlot Translation Group"
+    ... )
     >>> admin_browser.getControl("Summary").value = (
     ...     "The PolyGlots are a well organised translation group that "
     ...     "handles the work of translating a number of Ubuntu and upstream "
@@ -85,9 +85,9 @@ The same request will be accepted if the group is given a saner name,
 such as just "polyglot" (no upper-case letters).
 
     >>> admin_browser.getControl("Name").value = "polyglot"
-    >>> admin_browser.getControl(
-    ...     "Translation instructions"
-    ... ).value = "https://help.launchpad.net/Translations/PolyglotPolicies";
+    >>> admin_browser.getControl("Translation instructions").value = (
+    ...     "https://help.launchpad.net/Translations/PolyglotPolicies";
+    ... )
     >>> admin_browser.getControl("Create").click()
     >>> print(admin_browser.url)
     http://translations.launchpad.test/+groups/polyglot
@@ -240,9 +240,9 @@ Choosing another name should work though.
 You can also edit the generic translation instructions for the team
 
     >>> admin_browser.getLink("Change details").click()
-    >>> admin_browser.getControl(
-    ...     "Translation instructions"
-    ... ).value = "https://help.launchpad.net/Translations/RenamedGroup";
+    >>> admin_browser.getControl("Translation instructions").value = (
+    ...     "https://help.launchpad.net/Translations/RenamedGroup";
+    ... )
     >>> admin_browser.getControl("Change").click()
 
 Now, let's go have a look at where we can use these translation groups.
@@ -851,9 +851,9 @@ After No posts a translation, however, it is.
     >>> browser.getControl(
     ...     name="msgset_148_cy_translation_0_radiobutton"
     ... ).value = ["msgset_148_cy_translation_0_new"]
-    >>> browser.getControl(
-    ...     name="msgset_148_cy_translation_0_new"
-    ... ).value = "foo\n%i%i%i\n"
+    >>> browser.getControl(name="msgset_148_cy_translation_0_new").value = (
+    ...     "foo\n%i%i%i\n"
+    ... )
     >>> browser.getControl("Save & Continue").click()
     >>> print(browser.url)
     http://.../ubuntu/.../evolution/+pots/evolution-2.2/cy/20/+translate
@@ -1301,9 +1301,9 @@ Let's add a new suggestion as a person without privileges.
     >>> browser.getControl(
     ...     name="msgset_134_es_translation_0_new_checkbox"
     ... ).value = True
-    >>> browser.getControl(
-    ...     name="msgset_134_es_translation_0_new"
-    ... ).value = "new suggestion"
+    >>> browser.getControl(name="msgset_134_es_translation_0_new").value = (
+    ...     "new suggestion"
+    ... )
     >>> browser.getControl(name="submit_translations").click()
     >>> print(browser.url)
     http://.../ubuntu/.../evolution/+pots/evolution-2.2/es/+translate?...
diff --git a/lib/lp/translations/tests/test_pofile.py b/lib/lp/translations/tests/test_pofile.py
index 1d919a1..d0aab39 100644
--- a/lib/lp/translations/tests/test_pofile.py
+++ b/lib/lp/translations/tests/test_pofile.py
@@ -1004,9 +1004,9 @@ class TestTranslationSharedPOFile(TestCaseWithFactory):
             current_other=False,
         )
 
-        removeSecurityProxy(
-            self.devel_potemplate
-        ).messagecount = self.devel_potemplate.getPOTMsgSetsCount()
+        removeSecurityProxy(self.devel_potemplate).messagecount = (
+            self.devel_potemplate.getPOTMsgSetsCount()
+        )
 
         # Returns current, updates, rosetta, unreviewed counts.
         stats = self.devel_pofile.updateStatistics()
@@ -1840,14 +1840,14 @@ class TestPOFileSet(TestCaseWithFactory):
             distroseries=distroseries,
             sourcepackagename=target_package.sourcepackagename,
         )
-        removeSecurityProxy(
-            template
-        ).from_sourcepackagename = upload_package.sourcepackagename
+        removeSecurityProxy(template).from_sourcepackagename = (
+            upload_package.sourcepackagename
+        )
         pofile = template.newPOFile("ka")
         removeSecurityProxy(pofile).path = "ka.po"
-        removeSecurityProxy(
-            pofile
-        ).from_sourcepackagename = upload_package.sourcepackagename
+        removeSecurityProxy(pofile).from_sourcepackagename = (
+            upload_package.sourcepackagename
+        )
 
         found = self.pofileset.getPOFilesByPathAndOrigin(
             "ka.po",
diff --git a/lib/lp/translations/tests/test_potemplate.py b/lib/lp/translations/tests/test_potemplate.py
index 72f2fd8..e4228d3 100644
--- a/lib/lp/translations/tests/test_potemplate.py
+++ b/lib/lp/translations/tests/test_potemplate.py
@@ -596,9 +596,9 @@ class TestTranslationFoci(TestCaseWithFactory):
     @staticmethod
     def makePackageFocus(template):
         distribution = template.distroseries.distribution
-        removeSecurityProxy(
-            distribution
-        ).translation_focus = template.distroseries
+        removeSecurityProxy(distribution).translation_focus = (
+            template.distroseries
+        )
 
     def makeProductPOTemplate(self):
         """Create a product that is not the translation focus."""
diff --git a/lib/lp/translations/tests/test_translationsplitter.py b/lib/lp/translations/tests/test_translationsplitter.py
index f2c591b..5cc1cc4 100644
--- a/lib/lp/translations/tests/test_translationsplitter.py
+++ b/lib/lp/translations/tests/test_translationsplitter.py
@@ -135,12 +135,12 @@ class TestTranslationSplitter(TestCaseWithFactory):
         )
         splitter.splitPOTMsgSet(ubuntu_item)
         splitter.migrateTranslations(upstream_item.potmsgset, ubuntu_item)
-        (
-            upstream_translation,
-        ) = upstream_item.potmsgset.getAllTranslationMessages()
-        (
-            ubuntu_translation,
-        ) = ubuntu_item.potmsgset.getAllTranslationMessages()
+        (upstream_translation,) = (
+            upstream_item.potmsgset.getAllTranslationMessages()
+        )
+        (ubuntu_translation,) = (
+            ubuntu_item.potmsgset.getAllTranslationMessages()
+        )
         self.assertEqual(
             ubuntu_translation.translations, upstream_translation.translations
         )
diff --git a/lib/lp/translations/tests/test_translationtemplatesbuild.py b/lib/lp/translations/tests/test_translationtemplatesbuild.py
index aa09224..d7c1ca4 100644
--- a/lib/lp/translations/tests/test_translationtemplatesbuild.py
+++ b/lib/lp/translations/tests/test_translationtemplatesbuild.py
@@ -165,9 +165,9 @@ class TestTranslationTemplatesBuild(TestCaseWithFactory):
         branch = self._makeTranslationBranch(fake_pottery_compatible=True)
 
         trunk = branch.product.getSeries("trunk")
-        removeSecurityProxy(
-            trunk
-        ).translations_autoimport_mode = TranslationsBranchImportMode.NO_IMPORT
+        removeSecurityProxy(trunk).translations_autoimport_mode = (
+            TranslationsBranchImportMode.NO_IMPORT
+        )
 
         self.assertFalse(self.jobsource.generatesTemplates(branch))
 
diff --git a/utilities/massage-bug-import-xml b/utilities/massage-bug-import-xml
index cb4c0a2..860bfa0 100755
--- a/utilities/massage-bug-import-xml
+++ b/utilities/massage-bug-import-xml
@@ -173,24 +173,23 @@ def massage(root, project_name, fix_nickname, tag_nickname):
                 attachment = etree.SubElement(
                     first_comment, "{%s}attachment" % NS
                 )
-                etree.SubElement(
-                    attachment, "{%s}filename" % NS
-                ).text = "%s-bug-%s-full-description.txt" % (
-                    project_name,
-                    bug.get("id"),
+                etree.SubElement(attachment, "{%s}filename" % NS).text = (
+                    "%s-bug-%s-full-description.txt"
+                    % (
+                        project_name,
+                        bug.get("id"),
+                    )
+                )
+                etree.SubElement(attachment, "{%s}title" % NS).text = (
+                    "Full description (text/plain, utf-8)"
+                )
+                etree.SubElement(attachment, "{%s}mimetype" % NS).text = (
+                    "text/plain"
                 )
-                etree.SubElement(
-                    attachment, "{%s}title" % NS
-                ).text = "Full description (text/plain, utf-8)"
-                etree.SubElement(
-                    attachment, "{%s}mimetype" % NS
-                ).text = "text/plain"
-                etree.SubElement(
-                    attachment, "{%s}contents" % NS
-                ).text = standard_b64encode(
-                    first_comment_text.text.encode("utf-8")
-                ).decode(
-                    "ascii"
+                etree.SubElement(attachment, "{%s}contents" % NS).text = (
+                    standard_b64encode(
+                        first_comment_text.text.encode("utf-8")
+                    ).decode("ascii")
                 )
                 # Trim the comment text.
                 problem_resolution("Trimming comment text.")