← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:doctest-syntax into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:doctest-syntax into launchpad:master.

Commit message:
Fix syntax oddities in some doctests

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

Apparently not all of these are actually executed in test runs for one reason or another, but they confuse `blackdoc`.

The mismatched docstring delimiters would normally just be ugly, but they cause `blackdoc` to crash, which I've reported as https://github.com/keewis/blackdoc/issues/131.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:doctest-syntax into launchpad:master.
diff --git a/lib/lp/app/doc/textformatting.rst b/lib/lp/app/doc/textformatting.rst
index faee73c..83823b3 100644
--- a/lib/lp/app/doc/textformatting.rst
+++ b/lib/lp/app/doc/textformatting.rst
@@ -27,7 +27,7 @@ So, with textwrap:
     ...     "that the edit notification email generator knows how to indent "
     ...     "and wrap descriptions, so this will appear quite nice in the "
     ...     "actual email that gets sent.\n\n"
-    ...     "It's also smart enough to preserve whitespace, finally!""")
+    ...     "It's also smart enough to preserve whitespace, finally!")
     >>> wrapped_description = textwrap.fill(description, width=56)
     >>> print(wrapped_description)  #doctest: -NORMALIZE_WHITESPACE
     A new description that is quite long. But the nice thing
diff --git a/lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst b/lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst
index b2ed2c5..f9e2283 100644
--- a/lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst
+++ b/lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst
@@ -38,7 +38,7 @@ For this documentation, we'll also need a dummy new build farm job.
 
     >>> from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob
     >>> class IMyNewBuildFarmJob(IBuildFarmJob):
-    ...     "Normally defines job-type specific database fields."""
+    ...     """Normally defines job-type specific database fields."""
     >>> @implementer(IMyNewBuildFarmJob)
     ... class MyNewBuildFarmJob:
     ...     pass
diff --git a/lib/lp/services/mail/notification.py b/lib/lp/services/mail/notification.py
index 4658a38..90b39ef 100644
--- a/lib/lp/services/mail/notification.py
+++ b/lib/lp/services/mail/notification.py
@@ -88,7 +88,7 @@ def get_unified_diff(old_text, new_text, text_width):
     width.
 
         >>> print(get_unified_diff(
-        ...     'Some text\nAnother line\n',get_un
+        ...     'Some text\nAnother line\n',
         ...     'Some more text\nAnother line\n',
         ...     text_width=72))
         - Some text
diff --git a/lib/lp/testing/pages.py b/lib/lp/testing/pages.py
index accac95..632d4ec 100644
--- a/lib/lp/testing/pages.py
+++ b/lib/lp/testing/pages.py
@@ -614,8 +614,9 @@ def print_portlet_links(content, name, base=None):
     if there are no links to be found. Unlike the other functions on this
     page, this looks for "a" instead of "li". Example usage:
     --------------
-    >>> print_portlet_links(admin_browser.contents,'Milestone milestone3 for
-        Ubuntu details')
+    >>> print_portlet_links(
+    ...     admin_browser.contents, "Milestone milestone3 for Ubuntu details"
+    ... )
     Ubuntu: /ubuntu
     Warty: /ubuntu/warty
     --------------