Merge ~cjwatson/launchpad:doctest-imported-but-unused into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 97794a7ec2531e8ea7c35c67845ad7371ad107d7
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:doctest-imported-but-unused
Merge into: launchpad:master
Diff against target: 217 lines (+3/-25)
14 files modified
lib/lp/app/browser/doc/launchpad-search-pages.txt (+0/-1)
lib/lp/archiveuploader/tests/nascentupload-packageset.txt (+0/-1)
lib/lp/archiveuploader/tests/static-translations.txt (+1/-2)
lib/lp/bugs/doc/bugtask-find-similar.txt (+0/-3)
lib/lp/bugs/doc/checkwatches-batching.txt (+0/-1)
lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt (+0/-1)
lib/lp/code/stories/codeimport/xx-admin-codeimport.txt (+1/-1)
lib/lp/registry/doc/personlocation.txt (+0/-1)
lib/lp/registry/doc/poll-preconditions.txt (+0/-2)
lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt (+1/-3)
lib/lp/services/database/doc/textsearching.txt (+0/-3)
lib/lp/services/scripts/doc/launchpad-scripts.txt (+0/-4)
lib/lp/services/webservice/doc/webservice-error.txt (+0/-1)
lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.txt (+0/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+406175@code.launchpad.net

Commit message

Remove unused imports from doctests

Description of the change

Found by lp-lint-doctest.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Self-approving (trivial).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/app/browser/doc/launchpad-search-pages.txt b/lib/lp/app/browser/doc/launchpad-search-pages.txt
index abc6e37..5578b26 100644
--- a/lib/lp/app/browser/doc/launchpad-search-pages.txt
+++ b/lib/lp/app/browser/doc/launchpad-search-pages.txt
@@ -5,7 +5,6 @@ Users can search for Launchpad objects and pages from the search form
5located on all pages. The search is performed and displayed by the5located on all pages. The search is performed and displayed by the
6LaunchpadSearchView.6LaunchpadSearchView.
77
8 >>> import six
9 >>> from zope.component import getMultiAdapter, getUtility8 >>> from zope.component import getMultiAdapter, getUtility
10 >>> from lp.services.webapp.interfaces import ILaunchpadRoot9 >>> from lp.services.webapp.interfaces import ILaunchpadRoot
11 >>> from lp.services.webapp.servers import LaunchpadTestRequest10 >>> from lp.services.webapp.servers import LaunchpadTestRequest
diff --git a/lib/lp/archiveuploader/tests/nascentupload-packageset.txt b/lib/lp/archiveuploader/tests/nascentupload-packageset.txt
index 6ad0c8f..3397177 100644
--- a/lib/lp/archiveuploader/tests/nascentupload-packageset.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload-packageset.txt
@@ -48,7 +48,6 @@ This time the upload will fail because the ACLs don't let
48We can grant selective, package set based upload permissions to the user48We can grant selective, package set based upload permissions to the user
49in order to facilitate uploads.49in order to facilitate uploads.
5050
51 >>> import operator
52 >>> def print_permission(result_set):51 >>> def print_permission(result_set):
53 ... for perm in result_set.order_by(52 ... for perm in result_set.order_by(
54 ... 'person, permission, packageset, explicit'):53 ... 'person, permission, packageset, explicit'):
diff --git a/lib/lp/archiveuploader/tests/static-translations.txt b/lib/lp/archiveuploader/tests/static-translations.txt
index 52b7a25..f6b7baa 100644
--- a/lib/lp/archiveuploader/tests/static-translations.txt
+++ b/lib/lp/archiveuploader/tests/static-translations.txt
@@ -25,8 +25,7 @@ publishing behaviour using a mock PackageUploadCustom object:
25 >>> from lp.registry.interfaces.distribution import IDistributionSet25 >>> from lp.registry.interfaces.distribution import IDistributionSet
26 >>> from lp.registry.interfaces.pocket import PackagePublishingPocket26 >>> from lp.registry.interfaces.pocket import PackagePublishingPocket
27 >>> from lp.soyuz.enums import PackageUploadCustomFormat27 >>> from lp.soyuz.enums import PackageUploadCustomFormat
28 >>> from lp.soyuz.interfaces.queue import (28 >>> from lp.soyuz.interfaces.queue import IPackageUploadCustom
29 ... IPackageUpload, IPackageUploadCustom)
30 >>> from lp.soyuz.model.queue import PackageUploadCustom29 >>> from lp.soyuz.model.queue import PackageUploadCustom
31 >>> @implementer(IPackageUploadCustom)30 >>> @implementer(IPackageUploadCustom)
32 ... class MockPackageUploadCustom(PackageUploadCustom):31 ... class MockPackageUploadCustom(PackageUploadCustom):
diff --git a/lib/lp/bugs/doc/bugtask-find-similar.txt b/lib/lp/bugs/doc/bugtask-find-similar.txt
index b3396ee..204199c 100644
--- a/lib/lp/bugs/doc/bugtask-find-similar.txt
+++ b/lib/lp/bugs/doc/bugtask-find-similar.txt
@@ -13,8 +13,6 @@ It doesn't make much sense to find bugs similar to an empty string, so
13no results will be returned.13no results will be returned.
1414
15 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet15 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
16 >>> from lp.registry.interfaces.person import IPersonSet
17 >>> from lp.registry.interfaces.product import IProductSet
18 >>> test_product = factory.makeProduct()16 >>> test_product = factory.makeProduct()
19 >>> test_person = factory.makePerson()17 >>> test_person = factory.makePerson()
20 >>> similar_bugs = getUtility(IBugTaskSet).findSimilar(18 >>> similar_bugs = getUtility(IBugTaskSet).findSimilar(
@@ -101,7 +99,6 @@ Only bugs that the user has access to view will be searched. If we set
101one of our distro bugs to private, and repeat the search as a user who99one of our distro bugs to private, and repeat the search as a user who
102isn't allowed to view it, only the public bugs will show up.100isn't allowed to view it, only the public bugs will show up.
103101
104 >>> from lp.bugs.interfaces.bug import IBugSet
105 >>> login('test@canonical.com')102 >>> login('test@canonical.com')
106 >>> distro_bug_1.setPrivate(True, distro_bug_1.owner)103 >>> distro_bug_1.setPrivate(True, distro_bug_1.owner)
107 True104 True
diff --git a/lib/lp/bugs/doc/checkwatches-batching.txt b/lib/lp/bugs/doc/checkwatches-batching.txt
index 16b165b..5700e17 100644
--- a/lib/lp/bugs/doc/checkwatches-batching.txt
+++ b/lib/lp/bugs/doc/checkwatches-batching.txt
@@ -7,7 +7,6 @@ for batching up operations.
77
8 >>> import transaction8 >>> import transaction
9 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster9 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
10 >>> from pprint import pprint
1110
12 >>> updater = CheckwatchesMaster(transaction)11 >>> updater = CheckwatchesMaster(transaction)
13 >>> transaction.commit()12 >>> transaction.commit()
diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt b/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt
index e279296..e99a644 100644
--- a/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt
+++ b/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt
@@ -42,7 +42,6 @@ Only 'test bug a' is returned.
42 ... name='field.tag').value = 'test-tag-1 test-tag-2'42 ... name='field.tag').value = 'test-tag-1 test-tag-2'
43 >>> anon_browser.getControl(name='field.tags_combinator').value = ['ALL']43 >>> anon_browser.getControl(name='field.tags_combinator').value = ['ALL']
44 >>> anon_browser.getControl('Search', index=1).click()44 >>> anon_browser.getControl('Search', index=1).click()
45 >>> from lp.bugs.tests.bug import print_bugtasks
46 >>> 'test bug a' in anon_browser.contents45 >>> 'test bug a' in anon_browser.contents
47 True46 True
48 >>> 'test bug b' in anon_browser.contents47 >>> 'test bug b' in anon_browser.contents
diff --git a/lib/lp/code/stories/codeimport/xx-admin-codeimport.txt b/lib/lp/code/stories/codeimport/xx-admin-codeimport.txt
index d0d49ab..3ddf93e 100644
--- a/lib/lp/code/stories/codeimport/xx-admin-codeimport.txt
+++ b/lib/lp/code/stories/codeimport/xx-admin-codeimport.txt
@@ -11,7 +11,7 @@ to edit the details.
11 ... TargetRevisionControlSystems,11 ... TargetRevisionControlSystems,
12 ... )12 ... )
13 >>> from lp.code.tests.helpers import GitHostingFixture13 >>> from lp.code.tests.helpers import GitHostingFixture
14 >>> from lp.testing import ANONYMOUS, login, logout14 >>> from lp.testing import login, logout
15 >>> login('test@canonical.com')15 >>> login('test@canonical.com')
1616
17 >>> svn_import = factory.makeProductCodeImport(17 >>> svn_import = factory.makeProductCodeImport(
diff --git a/lib/lp/registry/doc/personlocation.txt b/lib/lp/registry/doc/personlocation.txt
index 779d3d9..afe5018 100644
--- a/lib/lp/registry/doc/personlocation.txt
+++ b/lib/lp/registry/doc/personlocation.txt
@@ -6,7 +6,6 @@ zone (which they can set) is stored together with their latitude/longitude (in
6PersonLocation). Until we move the time zone back to the Person table6PersonLocation). Until we move the time zone back to the Person table
7(bug=933699), we'll maintain the setLocation() API on IPerson.7(bug=933699), we'll maintain the setLocation() API on IPerson.
88
9 >>> from lp.testing import verifyObject
10 >>> from lp.registry.interfaces.person import IPersonSet9 >>> from lp.registry.interfaces.person import IPersonSet
11 >>> personset = getUtility(IPersonSet)10 >>> personset = getUtility(IPersonSet)
1211
diff --git a/lib/lp/registry/doc/poll-preconditions.txt b/lib/lp/registry/doc/poll-preconditions.txt
index f1fcc1c..b6d5dba 100644
--- a/lib/lp/registry/doc/poll-preconditions.txt
+++ b/lib/lp/registry/doc/poll-preconditions.txt
@@ -6,8 +6,6 @@ options from them, Not meeting these preconditions is a programming error and
6should be threated as so.6should be threated as so.
77
8 >>> from zope.component import getUtility8 >>> from zope.component import getUtility
9 >>> from lp.services.database.sqlbase import flush_database_updates
10 >>> from lp.testing import login
11 >>> from datetime import timedelta9 >>> from datetime import timedelta
12 >>> from lp.registry.interfaces.person import IPersonSet10 >>> from lp.registry.interfaces.person import IPersonSet
13 >>> from lp.registry.interfaces.poll import IPollSet11 >>> from lp.registry.interfaces.poll import IPollSet
diff --git a/lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt b/lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt
index 206cfcf..1cc088e 100644
--- a/lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt
+++ b/lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt
@@ -502,7 +502,7 @@ Now they'll request their key to be reactivated.
502502
503Get the token from the body of the email sent.503Get the token from the body of the email sent.
504504
505 >>> import email, re505 >>> import re
506 >>> from lp.services.mail import stub506 >>> from lp.services.mail import stub
507 >>> from_addr, to_addrs, raw_msg = stub.test_emails.pop()507 >>> from_addr, to_addrs, raw_msg = stub.test_emails.pop()
508 >>> msg = message_from_bytes(raw_msg)508 >>> msg = message_from_bytes(raw_msg)
@@ -549,7 +549,6 @@ And now we can see the key listed as one of Sample Person's active keys.
549This test verifies that we correctly handle keys which are in some way549This test verifies that we correctly handle keys which are in some way
550special: either invalid, broken, revoked, expired, or already imported.550special: either invalid, broken, revoked, expired, or already imported.
551551
552 >>> import email
553 >>> from lp.testing.keyserver import KeyServerTac552 >>> from lp.testing.keyserver import KeyServerTac
554 >>> from lp.services.mail import stub553 >>> from lp.services.mail import stub
555554
@@ -620,7 +619,6 @@ Ensure the CoC was acknowledge by searching in the CoC Admin Console:
620619
621Test if the advertisement email was sent:620Test if the advertisement email was sent:
622621
623 >>> import email
624 >>> from lp.services.mail import stub622 >>> from lp.services.mail import stub
625 >>> from_addr, to_addrs, raw_msg = stub.test_emails.pop()623 >>> from_addr, to_addrs, raw_msg = stub.test_emails.pop()
626 >>> msg = message_from_bytes(raw_msg)624 >>> msg = message_from_bytes(raw_msg)
diff --git a/lib/lp/services/database/doc/textsearching.txt b/lib/lp/services/database/doc/textsearching.txt
index 65d8f9d..63e5d5a 100644
--- a/lib/lp/services/database/doc/textsearching.txt
+++ b/lib/lp/services/database/doc/textsearching.txt
@@ -96,7 +96,6 @@ any syntax error exceptions being generated.
96The following examples show the text version of the query using96The following examples show the text version of the query using
97`_ftq(text)`, and the compiled version returned by `ftq(text)`97`_ftq(text)`, and the compiled version returned by `ftq(text)`
9898
99 >>> from lp.services.database.sqlbase import SQLBase
100 >>> def ftq(query):99 >>> def ftq(query):
101 ... try:100 ... try:
102 ... result = store.execute(101 ... result = store.execute(
@@ -691,7 +690,6 @@ that is matched by each term. Term matching 50% or more of the total
691rows will be excluded from the final search.690rows will be excluded from the final search.
692691
693 >>> from lp.services.database.nl_search import nl_phrase_search692 >>> from lp.services.database.nl_search import nl_phrase_search
694 >>> from lp.services.database.sqlbase import quote
695 >>> from lp.answers.model.question import Question693 >>> from lp.answers.model.question import Question
696694
697More than 50% of the questions matches firefox:695More than 50% of the questions matches firefox:
@@ -783,7 +781,6 @@ keywords could be eliminated. For that reason, when there are less than
783For example, there are less than 5 questions filed on the781For example, there are less than 5 questions filed on the
784mozilla-firefox source package.782mozilla-firefox source package.
785783
786 >>> from lp.services.database.sqlbase import sqlvalues
787 >>> from lp.registry.interfaces.distribution import IDistributionSet784 >>> from lp.registry.interfaces.distribution import IDistributionSet
788 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')785 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
789 >>> firefox_package = ubuntu.getSourcePackage('mozilla-firefox')786 >>> firefox_package = ubuntu.getSourcePackage('mozilla-firefox')
diff --git a/lib/lp/services/scripts/doc/launchpad-scripts.txt b/lib/lp/services/scripts/doc/launchpad-scripts.txt
index 7eea651..9a51be6 100644
--- a/lib/lp/services/scripts/doc/launchpad-scripts.txt
+++ b/lib/lp/services/scripts/doc/launchpad-scripts.txt
@@ -6,10 +6,6 @@ lp.services.scripts.base. This, along with the LaunchpadCronScript
6specialization, implement common behaviour for all Launchpad command6specialization, implement common behaviour for all Launchpad command
7line scripts.7line scripts.
88
9 >>> from lp.services.scripts.base import (
10 ... LaunchpadScript, LaunchpadCronScript)
11
12
13Scripts report their executution using the standard Python logging9Scripts report their executution using the standard Python logging
14module, with command line arguments and logging setup provided by10module, with command line arguments and logging setup provided by
15LaunchpadScript. Unhandled exceptions from scripts are automatically11LaunchpadScript. Unhandled exceptions from scripts are automatically
diff --git a/lib/lp/services/webservice/doc/webservice-error.txt b/lib/lp/services/webservice/doc/webservice-error.txt
index 5cf4404..47d6b31 100644
--- a/lib/lp/services/webservice/doc/webservice-error.txt
+++ b/lib/lp/services/webservice/doc/webservice-error.txt
@@ -4,7 +4,6 @@ Most of the time, if a web service client triggers an exception, the
4response code will be 500. But specific exception classes can override4response code will be 500. But specific exception classes can override
5this behaviour and set some other response code.5this behaviour and set some other response code.
66
7 >>> import threading
8 >>> from lp.services.webapp.servers import LaunchpadTestRequest7 >>> from lp.services.webapp.servers import LaunchpadTestRequest
9 >>> from lp.services.webapp.adapter import (8 >>> from lp.services.webapp.adapter import (
10 ... set_request_started, clear_request_started)9 ... set_request_started, clear_request_started)
diff --git a/lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.txt b/lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.txt
index e5fec7a..1187bda 100644
--- a/lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.txt
+++ b/lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.txt
@@ -5,7 +5,6 @@ translation of a message. If the current translation is good enough, new
5suggestions can be dismissed to keep them off the page.5suggestions can be dismissed to keep them off the page.
66
7 >>> from zope.component import getUtility7 >>> from zope.component import getUtility
8 >>> from lp.testing.pages import extract_url_parameter
9 >>> from lp.translations.interfaces.potemplate import IPOTemplateSet8 >>> from lp.translations.interfaces.potemplate import IPOTemplateSet
109
11 >>> login(ANONYMOUS)10 >>> login(ANONYMOUS)

Subscribers

People subscribed via source and target branches

to status/vote changes: