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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 11e9afe9a84926ac64e47a3c36720509e8663175
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:doctest-syntax
Merge into: launchpad:master
Diff against target: 55 lines (+6/-5)
4 files modified
lib/lp/app/doc/textformatting.rst (+1/-1)
lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst (+1/-1)
lib/lp/services/mail/notification.py (+1/-1)
lib/lp/testing/pages.py (+3/-2)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+427374@code.launchpad.net

Commit message

Fix syntax oddities in some doctests

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/app/doc/textformatting.rst b/lib/lp/app/doc/textformatting.rst
2index faee73c..83823b3 100644
3--- a/lib/lp/app/doc/textformatting.rst
4+++ b/lib/lp/app/doc/textformatting.rst
5@@ -27,7 +27,7 @@ So, with textwrap:
6 ... "that the edit notification email generator knows how to indent "
7 ... "and wrap descriptions, so this will appear quite nice in the "
8 ... "actual email that gets sent.\n\n"
9- ... "It's also smart enough to preserve whitespace, finally!""")
10+ ... "It's also smart enough to preserve whitespace, finally!")
11 >>> wrapped_description = textwrap.fill(description, width=56)
12 >>> print(wrapped_description) #doctest: -NORMALIZE_WHITESPACE
13 A new description that is quite long. But the nice thing
14diff --git a/lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst b/lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst
15index b2ed2c5..f9e2283 100644
16--- a/lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst
17+++ b/lib/lp/buildmaster/doc/buildfarmjobbehaviour.rst
18@@ -38,7 +38,7 @@ For this documentation, we'll also need a dummy new build farm job.
19
20 >>> from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob
21 >>> class IMyNewBuildFarmJob(IBuildFarmJob):
22- ... "Normally defines job-type specific database fields."""
23+ ... """Normally defines job-type specific database fields."""
24 >>> @implementer(IMyNewBuildFarmJob)
25 ... class MyNewBuildFarmJob:
26 ... pass
27diff --git a/lib/lp/services/mail/notification.py b/lib/lp/services/mail/notification.py
28index 4658a38..90b39ef 100644
29--- a/lib/lp/services/mail/notification.py
30+++ b/lib/lp/services/mail/notification.py
31@@ -88,7 +88,7 @@ def get_unified_diff(old_text, new_text, text_width):
32 width.
33
34 >>> print(get_unified_diff(
35- ... 'Some text\nAnother line\n',get_un
36+ ... 'Some text\nAnother line\n',
37 ... 'Some more text\nAnother line\n',
38 ... text_width=72))
39 - Some text
40diff --git a/lib/lp/testing/pages.py b/lib/lp/testing/pages.py
41index accac95..632d4ec 100644
42--- a/lib/lp/testing/pages.py
43+++ b/lib/lp/testing/pages.py
44@@ -614,8 +614,9 @@ def print_portlet_links(content, name, base=None):
45 if there are no links to be found. Unlike the other functions on this
46 page, this looks for "a" instead of "li". Example usage:
47 --------------
48- >>> print_portlet_links(admin_browser.contents,'Milestone milestone3 for
49- Ubuntu details')
50+ >>> print_portlet_links(
51+ ... admin_browser.contents, "Milestone milestone3 for Ubuntu details"
52+ ... )
53 Ubuntu: /ubuntu
54 Warty: /ubuntu/warty
55 --------------

Subscribers

People subscribed via source and target branches

to status/vote changes: