launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #19666
[Merge] lp:~cjwatson/launchpad/lint into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/lint into lp:launchpad.
Commit message:
Remove lots of lint from remaining subpackages.
Requested reviews:
Colin Watson (cjwatson)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/lint/+merge/275718
Remove lots of lint from remaining subpackages.
--
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/_schema_circular_imports.py'
--- lib/lp/_schema_circular_imports.py 2015-09-29 00:32:52 +0000
+++ lib/lp/_schema_circular_imports.py 2015-10-26 14:57:30 +0000
@@ -238,7 +238,8 @@
patch_collection_property(IBranch, 'linked_bugs', IBug)
patch_collection_property(IBranch, 'dependent_branches', IBranchMergeProposal)
patch_entry_return_type(IBranch, 'getSubscription', IBranchSubscription)
-patch_collection_property(IBranch, '_api_landing_candidates', IBranchMergeProposal)
+patch_collection_property(
+ IBranch, '_api_landing_candidates', IBranchMergeProposal)
patch_collection_property(IBranch, 'landing_targets', IBranchMergeProposal)
patch_plain_parameter_type(IBranch, 'linkBug', 'bug', IBug)
patch_plain_parameter_type(
=== modified file 'lib/lp/answers/browser/question.py'
--- lib/lp/answers/browser/question.py 2015-09-25 02:33:15 +0000
+++ lib/lp/answers/browser/question.py 2015-10-26 14:57:30 +0000
@@ -75,10 +75,7 @@
IAnswersFrontPageSearchForm,
IQuestionTarget,
)
-from lp.answers.vocabulary import (
- UsesAnswersDistributionVocabulary,
- UsesAnswersProductVocabulary,
- )
+from lp.answers.vocabulary import UsesAnswersDistributionVocabulary
from lp.app.browser.launchpadform import (
action,
custom_widget,
@@ -650,7 +647,7 @@
def context_uses_answers(self):
"""Return True if the context uses launchpad as an answer forum."""
usage = IServiceUsage(self.context)
- if usage is not None:
+ if usage is not None:
return usage.answers_usage == ServiceUsage.LAUNCHPAD
else:
return False
=== modified file 'lib/lp/answers/tests/test_question_webservice.py'
--- lib/lp/answers/tests/test_question_webservice.py 2015-10-13 16:58:20 +0000
+++ lib/lp/answers/tests/test_question_webservice.py 2015-10-26 14:57:30 +0000
@@ -14,7 +14,6 @@
from lazr.restfulclient.errors import HTTPError
import pytz
from simplejson import dumps
-from testtools.matchers import Equals
import transaction
from zope.security.proxy import removeSecurityProxy
=== modified file 'lib/lp/answers/tests/test_vocabulary.py'
--- lib/lp/answers/tests/test_vocabulary.py 2012-12-06 02:30:37 +0000
+++ lib/lp/answers/tests/test_vocabulary.py 2015-10-26 14:57:30 +0000
@@ -28,7 +28,7 @@
distribution = self.factory.makeDistribution()
vocabulary = UsesAnswersDistributionVocabulary(distribution)
self.assertEqual(distribution, vocabulary.context)
- self.assertEqual(distribution, vocabulary.distribution)
+ self.assertEqual(distribution, vocabulary.distribution)
def test_init_without_distribution(self):
# When the context is not adaptable to IDistribution, the
@@ -76,7 +76,7 @@
class UsesAnswersProductVocabularyTestCase(TestCaseWithFactory):
"""Test that the product vocabulary behaves as expected."""
-
+
layer = DatabaseFunctionalLayer
def test_products_not_using_answers_not_found(self):
=== modified file 'lib/lp/answers/vocabulary.py'
--- lib/lp/answers/vocabulary.py 2015-07-08 16:05:11 +0000
+++ lib/lp/answers/vocabulary.py 2015-10-26 14:57:30 +0000
@@ -17,7 +17,6 @@
from lp.answers.interfaces.faq import IFAQ
from lp.answers.interfaces.faqtarget import IFAQTarget
-from lp.app.enums import ServiceUsage
from lp.registry.interfaces.distribution import IDistribution
from lp.registry.model.product import Product
from lp.registry.vocabularies import (
@@ -98,6 +97,7 @@
return super(UsesAnswersProductVocabulary, self).search(
query, vocab_filter)
+
class UsesAnswersDistributionVocabulary(DistributionVocabulary):
"""Distributions that use Launchpad to track questions.
=== modified file 'lib/lp/app/browser/folder.py'
--- lib/lp/app/browser/folder.py 2015-07-08 16:05:11 +0000
+++ lib/lp/app/browser/folder.py 2015-10-26 14:57:30 +0000
@@ -134,7 +134,6 @@
can be served as "image1".
"""
-
# The extensions we consider.
image_extensions = ('.png', '.gif')
=== modified file 'lib/lp/app/browser/stringformatter.py'
--- lib/lp/app/browser/stringformatter.py 2015-08-13 22:19:45 +0000
+++ lib/lp/app/browser/stringformatter.py 2015-10-26 14:57:30 +0000
@@ -1023,10 +1023,12 @@
if line.startswith(' '):
line = line[1:]
cells = [
- '<td class="ss-line-no unselectable">%s</td>' % orig_row,
+ '<td class="ss-line-no unselectable">%s</td>' %
+ orig_row,
structured(
'<td class="text">%s</td>', line).escapedtext,
- '<td class="ss-line-no unselectable">%s</td>' % mod_row,
+ '<td class="ss-line-no unselectable">%s</td>' %
+ mod_row,
structured(
'<td class="text">%s</td>', line).escapedtext,
]
=== modified file 'lib/lp/app/browser/tests/test_formatters.py'
--- lib/lp/app/browser/tests/test_formatters.py 2012-11-12 16:11:19 +0000
+++ lib/lp/app/browser/tests/test_formatters.py 2015-10-26 14:57:30 +0000
@@ -94,6 +94,7 @@
'private',
formatter.global_css())
+
class TestPillarFormatterAPI(TestCaseWithFactory):
layer = DatabaseFunctionalLayer
=== modified file 'lib/lp/app/browser/tests/test_launchpadform_doc.py'
--- lib/lp/app/browser/tests/test_launchpadform_doc.py 2015-07-08 16:05:11 +0000
+++ lib/lp/app/browser/tests/test_launchpadform_doc.py 2015-10-26 14:57:30 +0000
@@ -33,8 +33,10 @@
# If more than one returns True, then that widget may get included
# in the form twice.
form = LaunchpadFormView(None, None)
+
class FakeWidget:
pass
+
widget = FakeWidget()
form.widgets = {'widget': widget}
# test every combination of the three interfaces:
@@ -67,21 +69,25 @@
"""Verify a field marked .for_display has no (Optional) marker."""
# IInputWidgets have an (Optional) marker if they are not required.
form = LaunchpadFormView(None, None)
+
@implementer(IInputWidget)
class FakeInputWidget:
def __init__(self, required):
self.required = required
+
form.widgets = {'widget': FakeInputWidget(required=False)}
self.assertTrue(form.showOptionalMarker('widget'))
# Required IInputWidgets have no (Optional) marker.
form.widgets = {'widget': FakeInputWidget(required=True)}
self.assertFalse(form.showOptionalMarker('widget'))
+
# IDisplayWidgets have no (Optional) marker, regardless of whether
# they are required or not, since they are read only.
@implementer(IDisplayWidget)
class FakeDisplayWidget:
def __init__(self, required):
self.required = required
+
form.widgets = {'widget': FakeDisplayWidget(required=False)}
self.assertFalse(form.showOptionalMarker('widget'))
form.widgets = {'widget': FakeDisplayWidget(required=True)}
=== modified file 'lib/lp/app/tests/test_security.py'
--- lib/lp/app/tests/test_security.py 2015-10-13 16:58:20 +0000
+++ lib/lp/app/tests/test_security.py 2015-10-26 14:57:30 +0000
@@ -3,7 +3,6 @@
__metaclass__ = type
-from testtools.matchers import Equals
from zope.component import (
getSiteManager,
getUtility,
@@ -246,8 +245,10 @@
team_status,
main_team_owner)
- checker = PublicOrPrivateTeamsExistence(removeSecurityProxy(private_team))
- self.assertTrue(checker.checkAuthenticated(IPersonRoles(main_team_owner)))
+ checker = PublicOrPrivateTeamsExistence(
+ removeSecurityProxy(private_team))
+ self.assertTrue(
+ checker.checkAuthenticated(IPersonRoles(main_team_owner)))
def test_can_list_team_with_deactivated_private_team(self):
self.assertTeamOwnerCanListPrivateTeamWithTeamStatus(
=== modified file 'lib/lp/app/validators/cve.py'
--- lib/lp/app/validators/cve.py 2014-03-03 19:42:30 +0000
+++ lib/lp/app/validators/cve.py 2015-10-26 14:57:30 +0000
@@ -21,7 +21,7 @@
True
And leading zeros were required for sequence in [1-999]:
-
+
>>> valid_cve('2014-999')
False
>>> valid_cve('2014-0999')
=== modified file 'lib/lp/app/validators/version.py'
--- lib/lp/app/validators/version.py 2009-07-17 00:26:05 +0000
+++ lib/lp/app/validators/version.py 2015-10-26 14:57:30 +0000
@@ -109,4 +109,3 @@
$""", version):
return True
return False
-
=== modified file 'lib/lp/app/widgets/announcementdate.py'
--- lib/lp/app/widgets/announcementdate.py 2015-07-08 16:05:11 +0000
+++ lib/lp/app/widgets/announcementdate.py 2015-10-26 14:57:30 +0000
@@ -120,6 +120,4 @@
elif action == "specific":
return announcement_date
else:
- raise AssertionError, 'Unknown action in AnnouncementDateWidget'
-
-
+ raise AssertionError('Unknown action in AnnouncementDateWidget')
=== modified file 'lib/lp/app/widgets/launchpadtarget.py'
--- lib/lp/app/widgets/launchpadtarget.py 2015-07-08 16:05:11 +0000
+++ lib/lp/app/widgets/launchpadtarget.py 2015-10-26 14:57:30 +0000
@@ -50,7 +50,7 @@
def getDistributionVocabulary(self):
return 'Distribution'
-
+
def getProductVocabulary(self):
return 'Product'
=== modified file 'lib/lp/app/widgets/suggestion.py'
--- lib/lp/app/widgets/suggestion.py 2015-04-30 12:29:47 +0000
+++ lib/lp/app/widgets/suggestion.py 2015-10-26 14:57:30 +0000
@@ -236,7 +236,8 @@
collection = collection.visibleByUser(logged_in_user)
# May actually need some eager loading, but the API isn't fine grained
# yet.
- branches = collection.getBranches(eager_load=False).config(distinct=True)
+ branches = collection.getBranches(eager_load=False).config(
+ distinct=True)
target_branches = list(branches.config(limit=5))
# If there is a development focus branch, make sure it is always
# shown, and as the first item.
=== modified file 'lib/lp/blueprints/browser/specificationgoal.py'
--- lib/lp/blueprints/browser/specificationgoal.py 2012-01-01 02:58:52 +0000
+++ lib/lp/blueprints/browser/specificationgoal.py 2015-10-26 14:57:30 +0000
@@ -106,4 +106,3 @@
self.request.response.redirect(self.request.URL)
return self.status_message
-
=== modified file 'lib/lp/blueprints/interfaces/specificationdependency.py'
--- lib/lp/blueprints/interfaces/specificationdependency.py 2015-07-08 16:05:11 +0000
+++ lib/lp/blueprints/interfaces/specificationdependency.py 2015-10-26 14:57:30 +0000
@@ -63,4 +63,3 @@
@property
def dependency(self):
return self.specdep.dependency
-
=== modified file 'lib/lp/blueprints/interfaces/webservice.py'
--- lib/lp/blueprints/interfaces/webservice.py 2014-06-17 02:01:34 +0000
+++ lib/lp/blueprints/interfaces/webservice.py 2015-10-26 14:57:30 +0000
@@ -13,7 +13,9 @@
'GoalProposeError',
'ISpecification',
'ISpecificationBranch',
+ 'ISpecificationSet',
'ISpecificationSubscription',
+ 'ISpecificationTarget',
]
# XXX: JonathanLange 2010-11-09 bug=673083: Legacy work-around for circular
=== modified file 'lib/lp/blueprints/model/specificationdependency.py'
--- lib/lp/blueprints/model/specificationdependency.py 2015-07-08 16:05:11 +0000
+++ lib/lp/blueprints/model/specificationdependency.py 2015-10-26 14:57:30 +0000
@@ -23,5 +23,3 @@
foreignKey='Specification', notNull=True)
dependency = ForeignKey(dbName='dependency',
foreignKey='Specification', notNull=True)
-
-
=== modified file 'lib/lp/blueprints/model/specificationsearch.py'
--- lib/lp/blueprints/model/specificationsearch.py 2013-08-23 05:36:46 +0000
+++ lib/lp/blueprints/model/specificationsearch.py 2015-10-26 14:57:30 +0000
@@ -108,13 +108,14 @@
order.extend([Desc(Specification.datecreated), Specification.id])
else:
order = [sort]
+
# Set the _known_viewers property for each specification, as well as
# preloading the objects involved, if asked.
def preload_hook(rows):
person_ids = set()
work_items_by_spec = defaultdict(list)
for spec in rows:
- if need_people:
+ if need_people:
person_ids |= set(
[spec._assigneeID, spec._approverID, spec._drafterID])
if need_branches:
@@ -259,7 +260,6 @@
return cache_user_can_view_spec
-
def get_specification_started_clause():
return Or(Not(Specification.implementation_status.is_in([
SpecificationImplementationStatus.UNKNOWN,
=== modified file 'lib/lp/blueprints/model/sprintspecification.py'
--- lib/lp/blueprints/model/sprintspecification.py 2015-07-08 16:05:11 +0000
+++ lib/lp/blueprints/model/sprintspecification.py 2015-10-26 14:57:30 +0000
@@ -66,4 +66,3 @@
self.status = SprintSpecificationStatus.DECLINED
self.decider = decider
self.date_decided = UTC_NOW
-
=== modified file 'lib/lp/blueprints/model/tests/test_specification.py'
--- lib/lp/blueprints/model/tests/test_specification.py 2015-07-21 09:04:01 +0000
+++ lib/lp/blueprints/model/tests/test_specification.py 2015-10-26 14:57:30 +0000
@@ -663,10 +663,12 @@
def test_workitemspecificationset_can_unlink_milestones(self):
milestone_a = self.factory.makeMilestone()
milestone_b = self.factory.makeMilestone()
- work_item_1 = self.factory.makeSpecificationWorkItem(milestone=milestone_a)
- work_item_2 = self.factory.makeSpecificationWorkItem(milestone=milestone_a)
- work_item_3 = self.factory.makeSpecificationWorkItem(milestone=milestone_b)
-
+ work_item_1 = self.factory.makeSpecificationWorkItem(
+ milestone=milestone_a)
+ work_item_2 = self.factory.makeSpecificationWorkItem(
+ milestone=milestone_a)
+ work_item_3 = self.factory.makeSpecificationWorkItem(
+ milestone=milestone_b)
self.assertEqual(milestone_a, work_item_1.milestone)
self.assertEqual(milestone_a, work_item_2.milestone)
=== modified file 'lib/lp/blueprints/subscribers.py'
--- lib/lp/blueprints/subscribers.py 2013-06-26 09:15:02 +0000
+++ lib/lp/blueprints/subscribers.py 2015-10-26 14:57:30 +0000
@@ -4,7 +4,6 @@
__metaclass__ = type
-from lp.blueprints.enums import SpecificationGoalStatus
from lp.registry.interfaces.person import IPerson
from lp.services.database.sqlbase import block_implicit_flushes
=== modified file 'lib/lp/coop/answersbugs/browser.py'
--- lib/lp/coop/answersbugs/browser.py 2015-09-29 05:29:46 +0000
+++ lib/lp/coop/answersbugs/browser.py 2015-10-26 14:57:30 +0000
@@ -76,6 +76,3 @@
self.request.response.addNotification(
_('Thank you! Bug #$bugid created.', mapping={'bugid': bug.id}))
self.next_url = canonical_url(bug)
-
-
-
=== modified file 'lib/lp/registry/browser/__init__.py'
--- lib/lp/registry/browser/__init__.py 2015-03-01 22:40:24 +0000
+++ lib/lp/registry/browser/__init__.py 2015-10-26 14:57:30 +0000
@@ -30,7 +30,9 @@
LaunchpadEditFormView,
)
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
-from lp.blueprints.interfaces.specificationworkitem import ISpecificationWorkItemSet
+from lp.blueprints.interfaces.specificationworkitem import (
+ ISpecificationWorkItemSet,
+ )
from lp.bugs.interfaces.bugtask import IBugTaskSet
from lp.bugs.interfaces.bugtasksearch import BugTaskSearchParams
from lp.registry.interfaces.productseries import IProductSeries
=== modified file 'lib/lp/registry/browser/featuredproject.py'
--- lib/lp/registry/browser/featuredproject.py 2012-01-01 02:58:52 +0000
+++ lib/lp/registry/browser/featuredproject.py 2015-10-26 14:57:30 +0000
@@ -75,5 +75,3 @@
@property
def action_url(self):
return "/+featuredprojects"
-
-
=== modified file 'lib/lp/registry/browser/tests/test_distribution_views.py'
--- lib/lp/registry/browser/tests/test_distribution_views.py 2015-10-14 09:50:44 +0000
+++ lib/lp/registry/browser/tests/test_distribution_views.py 2015-10-26 14:57:30 +0000
@@ -4,10 +4,7 @@
__metaclass__ = type
import soupmatchers
-from testtools.matchers import (
- Equals,
- MatchesStructure,
- )
+from testtools.matchers import MatchesStructure
from zope.component import getUtility
from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet
=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
--- lib/lp/registry/browser/tests/test_distroseries.py 2015-10-14 09:50:44 +0000
+++ lib/lp/registry/browser/tests/test_distroseries.py 2015-10-26 14:57:30 +0000
@@ -25,7 +25,6 @@
from testtools.content_type import UTF8_TEXT
from testtools.matchers import (
EndsWith,
- Equals,
LessThan,
Not,
)
=== modified file 'lib/lp/registry/browser/tests/test_distroseriesdifference_views.py'
--- lib/lp/registry/browser/tests/test_distroseriesdifference_views.py 2013-05-09 08:53:01 +0000
+++ lib/lp/registry/browser/tests/test_distroseriesdifference_views.py 2015-10-26 14:57:30 +0000
@@ -391,7 +391,7 @@
with person_logged_in(self.factory.makePerson()):
view = create_initialized_view(
- ds_diff, '+listing-distroseries-extra')#, principal=user)
+ ds_diff, '+listing-distroseries-extra') #, principal=user)
soup = BeautifulSoup(view())
# Both diffs present simple text repr. of proposed diff.
self.assertEqual(2, self.number_of_request_diff_texts(soup))
=== modified file 'lib/lp/registry/browser/tests/test_person_webservice.py'
--- lib/lp/registry/browser/tests/test_person_webservice.py 2015-10-13 16:58:20 +0000
+++ lib/lp/registry/browser/tests/test_person_webservice.py 2015-10-26 14:57:30 +0000
@@ -4,7 +4,6 @@
__metaclass__ = type
from storm.store import Store
-from testtools.matchers import Equals
from zope.component import getUtility
from zope.security.management import endInteraction
from zope.security.proxy import removeSecurityProxy
=== modified file 'lib/lp/registry/browser/tests/test_productrelease.py'
--- lib/lp/registry/browser/tests/test_productrelease.py 2015-02-01 22:33:29 +0000
+++ lib/lp/registry/browser/tests/test_productrelease.py 2015-10-26 14:57:30 +0000
@@ -83,8 +83,7 @@
maintainer = release.milestone.product.owner
form = self.makeForm('foo', file_release_type)
with person_logged_in(maintainer):
- view = create_initialized_view(
- release, '+adddownloadfile', form=form)
+ create_initialized_view(release, '+adddownloadfile', form=form)
self.assertEqual(1, release.files.count())
self.assertEqual(
expected_mimetype,
@@ -99,4 +98,3 @@
self.assertFileHasMimeType('README', "text/plain")
self.assertFileHasMimeType('CHANGELOG', "text/plain")
self.assertFileHasMimeType('RELEASENOTES', "text/plain")
-
=== modified file 'lib/lp/registry/browser/tests/test_sshkey.py'
--- lib/lp/registry/browser/tests/test_sshkey.py 2012-08-17 20:53:50 +0000
+++ lib/lp/registry/browser/tests/test_sshkey.py 2015-10-26 14:57:30 +0000
@@ -55,9 +55,12 @@
browser = setupBrowserFreshLogin(person)
browser.open(url)
browser.getControl('Remove').click()
- msg = 'Key "x<script>alert()</script>example.com" removed'
+ msg = (
+ 'Key "x<script>alert()</script>example.com" '
+ 'removed')
self.assertEqual(
- extract_text(find_tags_by_class(browser.contents, 'message')[0]),
+ extract_text(
+ find_tags_by_class(browser.contents, 'message')[0]),
msg)
def test_edit_ssh_keys_login_redirect(self):
=== modified file 'lib/lp/registry/browser/tests/test_team.py'
--- lib/lp/registry/browser/tests/test_team.py 2015-10-01 10:25:19 +0000
+++ lib/lp/registry/browser/tests/test_team.py 2015-10-26 14:57:30 +0000
@@ -925,5 +925,6 @@
superteams = find_tag_by_id(html, 'subteam-of')
self.assertFalse('<hidden>' in superteams)
self.assertEqual(
- '<a href="/~private-team" class="sprite team private">Private Team</a>',
+ '<a href="/~private-team" class="sprite team private">'
+ 'Private Team</a>',
str(superteams.findNext('a')))
=== modified file 'lib/lp/registry/interfaces/codeofconduct.py'
--- lib/lp/registry/interfaces/codeofconduct.py 2013-01-07 02:40:55 +0000
+++ lib/lp/registry/interfaces/codeofconduct.py 2015-10-26 14:57:30 +0000
@@ -85,7 +85,6 @@
"is considered active.")
)
-
displayname = Attribute("Fancy Title for CoC.")
def sendAdvertisementEmail(subject, content):
@@ -147,6 +146,7 @@
of Code of Conduct Signature.
"""
+
class ICodeOfConductConf(Interface):
"""Component to store the CoC Configuration."""
=== modified file 'lib/lp/registry/interfaces/distributionmirror.py'
--- lib/lp/registry/interfaces/distributionmirror.py 2015-10-13 13:22:08 +0000
+++ lib/lp/registry/interfaces/distributionmirror.py 2015-10-26 14:57:30 +0000
@@ -277,7 +277,7 @@
if IDistributionMirror.providedBy(self.context):
orig_value = self.get(self.context)
if orig_value is not None and URI(orig_value) == uri:
- return # url was not changed
+ return # url was not changed
mirror = self.getMirrorByURI(str(uri))
if mirror is not None:
=== modified file 'lib/lp/registry/interfaces/featuredproject.py'
--- lib/lp/registry/interfaces/featuredproject.py 2013-01-07 02:40:55 +0000
+++ lib/lp/registry/interfaces/featuredproject.py 2015-10-26 14:57:30 +0000
@@ -23,4 +23,3 @@
def destroySelf():
"""Remove this project from the featured project list."""
-
=== modified file 'lib/lp/registry/interfaces/poll.py'
--- lib/lp/registry/interfaces/poll.py 2013-01-07 02:40:55 +0000
+++ lib/lp/registry/interfaces/poll.py 2015-10-26 14:57:30 +0000
@@ -495,4 +495,3 @@
Raises a TypeError if the given option doesn't belong to a
simple-style poll.
"""
-
=== modified file 'lib/lp/registry/interfaces/ssh.py'
--- lib/lp/registry/interfaces/ssh.py 2013-01-07 02:40:55 +0000
+++ lib/lp/registry/interfaces/ssh.py 2015-10-26 14:57:30 +0000
@@ -92,4 +92,3 @@
class SSHKeyCompromisedError(Exception):
"""Raised when the SSH public key is known to be easily compromisable."""
-
=== modified file 'lib/lp/registry/model/featuredproject.py'
--- lib/lp/registry/model/featuredproject.py 2015-07-08 16:05:11 +0000
+++ lib/lp/registry/model/featuredproject.py 2015-10-26 14:57:30 +0000
@@ -27,4 +27,3 @@
_defaultOrder = ['id']
pillar_name = IntCol(notNull=True)
-
=== modified file 'lib/lp/registry/model/gpgkey.py'
--- lib/lp/registry/model/gpgkey.py 2015-07-08 16:05:11 +0000
+++ lib/lp/registry/model/gpgkey.py 2015-10-26 14:57:30 +0000
@@ -128,4 +128,3 @@
query += ' AND owner=%s' % sqlvalues(ownerid)
return GPGKey.select(query, orderBy='id')
-
=== modified file 'lib/lp/registry/model/personlocation.py'
--- lib/lp/registry/model/personlocation.py 2015-07-08 16:05:11 +0000
+++ lib/lp/registry/model/personlocation.py 2015-10-26 14:57:30 +0000
@@ -32,7 +32,7 @@
@implementer(IPersonLocation)
class PersonLocation(SQLBase):
"""A person's location."""
-
+
_defaultOrder = ['id']
date_created = UtcDateTimeCol(notNull=True, default=UTC_NOW)
=== modified file 'lib/lp/registry/tests/test_doc.py'
--- lib/lp/registry/tests/test_doc.py 2012-09-16 00:11:20 +0000
+++ lib/lp/registry/tests/test_doc.py 2015-10-26 14:57:30 +0000
@@ -8,9 +8,6 @@
import logging
import os
-import transaction
-
-from lp.registry.tests import mailinglists_helper
from lp.services.testing import (
build_doctest_suite,
build_test_suite,
=== modified file 'lib/lp/registry/tests/test_doc_project.py'
--- lib/lp/registry/tests/test_doc_project.py 2011-12-28 17:03:06 +0000
+++ lib/lp/registry/tests/test_doc_project.py 2015-10-26 14:57:30 +0000
@@ -18,6 +18,7 @@
test.globs['getUtility'] = getUtility
login(ANONYMOUS)
+
def test_suite():
suite = DocTestSuite('lp.registry.model.projectgroup', setUp=setUp)
suite.layer = LaunchpadFunctionalLayer
=== modified file 'lib/lp/registry/tests/test_nickname.py'
--- lib/lp/registry/tests/test_nickname.py 2013-01-14 06:20:57 +0000
+++ lib/lp/registry/tests/test_nickname.py 2015-10-26 14:57:30 +0000
@@ -39,7 +39,7 @@
self.assertEqual(['bar', 'foo-bar', 'foo-bar', 'foo+bar'], nicks)
def test_enforces_minimum_length(self):
- # Nicks must be a minimum length. generate_nick enforces this by
+ # Nicks must be a minimum length. generate_nick enforces this by
# adding random suffixes to the required length.
self.assertIs(None, getUtility(IPersonSet).getByName('i'))
nick = generate_nick('i@xxxxxxxxxxx')
=== modified file 'lib/lp/registry/tests/test_person_adaption.py'
--- lib/lp/registry/tests/test_person_adaption.py 2011-12-22 05:09:10 +0000
+++ lib/lp/registry/tests/test_person_adaption.py 2015-10-26 14:57:30 +0000
@@ -12,4 +12,3 @@
def test_suite():
return LayeredDocFileSuite('person_from_principal.txt')
-
=== modified file 'lib/lp/registry/tests/test_personnotification.py'
--- lib/lp/registry/tests/test_personnotification.py 2012-04-16 14:53:18 +0000
+++ lib/lp/registry/tests/test_personnotification.py 2015-10-26 14:57:30 +0000
@@ -18,7 +18,6 @@
from zope.security.proxy import removeSecurityProxy
from lp.registry.interfaces.personnotification import IPersonNotificationSet
-from lp.registry.model.personnotification import PersonNotification
from lp.registry.scripts.personnotification import PersonNotificationManager
from lp.services.config import config
from lp.testing import (
@@ -26,7 +25,6 @@
TestCaseWithFactory,
)
from lp.testing.layers import DatabaseFunctionalLayer
-from lp.testing.mail_helpers import pop_notifications
class TestPersonNotification(TestCaseWithFactory):
=== modified file 'lib/lp/registry/tests/test_prf_hose.py'
--- lib/lp/registry/tests/test_prf_hose.py 2012-01-01 02:58:52 +0000
+++ lib/lp/registry/tests/test_prf_hose.py 2015-10-26 14:57:30 +0000
@@ -63,11 +63,14 @@
"""Hose constructor calls reduceWork function."""
from lp.registry.scripts.productreleasefinder.hose import Hose
h = Hose.__new__(Hose)
+
class Observer(InstrumentedMethodObserver):
def __init__(self):
self.called_it = False
+
def called(self, name, args, kw):
self.called_it = True
+
obs = Observer()
instrument_method(obs, h, "reduceWork")
h.__init__()
@@ -80,11 +83,14 @@
FilterPattern)
pattern = FilterPattern("foo", "http://archive.ubuntu.com/e*")
h = Hose.__new__(Hose)
+
class Observer(InstrumentedMethodObserver):
def __init__(self):
self.args = []
+
def called(self, name, args, kw):
self.args.append(args)
+
obs = Observer()
instrument_method(obs, h, "reduceWork")
h.__init__([pattern])
@@ -94,6 +100,7 @@
def testSetsUrlProperty(self):
"""Hose constructor sets urls property to reduceWork return value."""
from lp.registry.scripts.productreleasefinder.hose import Hose
+
class TestHose(Hose):
def reduceWork(self, url_list):
return "wibble"
=== modified file 'lib/lp/snappy/browser/tests/test_snaplisting.py'
--- lib/lp/snappy/browser/tests/test_snaplisting.py 2015-10-13 16:58:20 +0000
+++ lib/lp/snappy/browser/tests/test_snaplisting.py 2015-10-26 14:57:30 +0000
@@ -6,10 +6,7 @@
__metaclass__ = type
import soupmatchers
-from testtools.matchers import (
- Equals,
- Not,
- )
+from testtools.matchers import Not
from lp.services.database.constants import (
ONE_DAY_AGO,
=== modified file 'lib/lp/testing/event.py'
--- lib/lp/testing/event.py 2011-12-30 07:38:46 +0000
+++ lib/lp/testing/event.py 2015-10-26 14:57:30 +0000
@@ -39,4 +39,3 @@
# self._active to False in order to make the handler return
# without doing anything.
self._active = False
-
=== modified file 'lib/lp/testing/keyserver/harness.py'
--- lib/lp/testing/keyserver/harness.py 2011-12-29 05:29:36 +0000
+++ lib/lp/testing/keyserver/harness.py 2015-10-26 14:57:30 +0000
@@ -39,7 +39,6 @@
def logfile(self):
return os.path.join(self.root, 'testkeyserver.log')
-
@property
def url(self):
"""The URL that the web server will be running on."""
=== modified file 'lib/lp/testing/keyserver/tests/test_locate_key.py'
--- lib/lp/testing/keyserver/tests/test_locate_key.py 2011-02-17 13:52:17 +0000
+++ lib/lp/testing/keyserver/tests/test_locate_key.py 2015-10-26 14:57:30 +0000
@@ -34,4 +34,3 @@
def test_locate_key_no_match(self):
self.assertKeyFile('0xDEADBEEF.get', None)
-
=== modified file 'lib/lp/testing/pages.py'
--- lib/lp/testing/pages.py 2015-09-01 17:10:46 +0000
+++ lib/lp/testing/pages.py 2015-10-26 14:57:30 +0000
@@ -866,8 +866,7 @@
# Add tests to the suite individually.
if filenames:
checker = doctest.OutputChecker()
- paths=[os.path.join(storydir, filename)
- for filename in filenames]
+ paths = [os.path.join(storydir, filename) for filename in filenames]
suite.addTest(LayeredDocFileSuite(
paths=paths,
package=package, checker=checker, stdout_logging=False,
=== modified file 'lib/lp/testing/publication.py'
--- lib/lp/testing/publication.py 2013-04-09 09:47:58 +0000
+++ lib/lp/testing/publication.py 2015-10-26 14:57:30 +0000
@@ -32,6 +32,7 @@
from lp.services.webapp.interfaces import IOpenLaunchBag
from lp.services.webapp.servers import ProtocolErrorPublication
+
# Defines an helper function that returns the appropriate
# IRequest and IPublication.
def get_request_and_publication(host='localhost', port=None,
=== modified file 'lib/lp/testing/tests/test_inlinetests.py'
--- lib/lp/testing/tests/test_inlinetests.py 2012-06-06 16:04:34 +0000
+++ lib/lp/testing/tests/test_inlinetests.py 2015-10-26 14:57:30 +0000
@@ -19,5 +19,5 @@
[],
layer=BaseLayer)
suite.addTest(doctest.DocTestSuite(
- testing, optionflags=NORMALIZE_WHITESPACE|ELLIPSIS))
+ testing, optionflags=NORMALIZE_WHITESPACE | ELLIPSIS))
return suite
=== modified file 'lib/lp/testing/tests/test_login.py'
--- lib/lp/testing/tests/test_login.py 2013-04-09 09:47:58 +0000
+++ lib/lp/testing/tests/test_login.py 2015-10-26 14:57:30 +0000
@@ -257,7 +257,6 @@
self.assertTrue(person.inTeam(vcs_imports))
def test_celebrity_logged_in_provides_person(self):
- vcs_imports = getUtility(ILaunchpadCelebrities).vcs_imports
with celebrity_logged_in('vcs_imports') as p:
person = self.getLoggedInPerson()
self.assertEqual(p, person)
=== modified file 'lib/lp/testing/tests/test_standard_yuixhr_test_template.py'
--- lib/lp/testing/tests/test_standard_yuixhr_test_template.py 2015-09-18 00:21:39 +0000
+++ lib/lp/testing/tests/test_standard_yuixhr_test_template.py 2015-10-26 14:57:30 +0000
@@ -101,6 +101,8 @@
# have been mutating the "data" dict that was passed in. (This
# will become slightly more important if you ever want to use
# .extend.)
+
+
@example.add_cleanup
def example(request, data):
# This is an example of a cleanup function, which will be called
=== modified file 'lib/lp/testing/tests/test_yuixhr_fixture.py'
--- lib/lp/testing/tests/test_yuixhr_fixture.py 2011-12-19 23:38:16 +0000
+++ lib/lp/testing/tests/test_yuixhr_fixture.py 2015-10-26 14:57:30 +0000
@@ -37,6 +37,8 @@
@setup
def second(request, data):
data['second'] = 'here'
+
+
@second.add_cleanup
def second(request, data):
global _received
@@ -50,6 +52,8 @@
global test_value
data['previous_value'] = test_value
test_value = None
+
+
@faux_database_thing.add_cleanup
def faux_database_thing(request, data):
global test_value
@@ -59,6 +63,8 @@
@setup
def show_teardown_value(request, data):
data['setup_data'] = 'Hello world'
+
+
@show_teardown_value.add_cleanup
def show_teardown_value(request, data):
global test_value
@@ -87,6 +93,8 @@
@setup
def teardown_will_fail(request, data):
pass
+
+
@teardown_will_fail.add_cleanup
def teardown_will_fail(request, data):
raise RuntimeError('rutebegas')
=== modified file 'lib/lp/tests/test_no_conflict_marker.py'
--- lib/lp/tests/test_no_conflict_marker.py 2009-07-13 03:05:37 +0000
+++ lib/lp/tests/test_no_conflict_marker.py 2015-10-26 14:57:30 +0000
@@ -46,4 +46,4 @@
if __name__ == '__main__':
- unittest.main()
\ No newline at end of file
+ unittest.main()
=== modified file 'lib/lp/tests/test_opensource.py'
--- lib/lp/tests/test_opensource.py 2011-12-28 17:03:06 +0000
+++ lib/lp/tests/test_opensource.py 2015-10-26 14:57:30 +0000
@@ -34,7 +34,7 @@
packages = []
for dirpath, dirnames, filenames in os.walk(topdir):
if 'docs' in dirnames:
- docsdir = os.path.join(dirpath, 'docs')[len(topdir)+1:]
+ docsdir = os.path.join(dirpath, 'docs')[len(topdir) + 1:]
packages.append(docsdir)
doctest_files = {}
for docsdir in packages:
=== modified file 'lib/lp/xmlrpc/__init__.py'
--- lib/lp/xmlrpc/__init__.py 2013-01-07 02:40:55 +0000
+++ lib/lp/xmlrpc/__init__.py 2015-10-26 14:57:30 +0000
@@ -2,5 +2,3 @@
# GNU Affero General Public License version 3 (see the file LICENSE).
"""XMLRPC views and APIs on Launchpad objects."""
-
-
=== modified file 'lib/lp/xmlrpc/application.py'
--- lib/lp/xmlrpc/application.py 2015-07-08 16:05:11 +0000
+++ lib/lp/xmlrpc/application.py 2015-10-26 14:57:30 +0000
@@ -33,6 +33,7 @@
from lp.services.webapp.interfaces import ILaunchBag
from lp.xmlrpc.interfaces import IPrivateApplication
+
# NOTE: If you add a traversal here, you should update
# the regular expression in utilities/page-performance-report.ini
@implementer(IPrivateApplication)
=== modified file 'lib/lp/xmlrpc/tests/test_private_xmlrpc.py'
--- lib/lp/xmlrpc/tests/test_private_xmlrpc.py 2015-10-05 06:34:17 +0000
+++ lib/lp/xmlrpc/tests/test_private_xmlrpc.py 2015-10-26 14:57:30 +0000
@@ -11,7 +11,6 @@
from lp.services.verification.interfaces.logintoken import ILoginTokenSet
from lp.testing import (
anonymous_logged_in,
- person_logged_in,
TestCase,
)
from lp.testing.layers import LaunchpadFunctionalLayer
@@ -67,7 +66,8 @@
with anonymous_logged_in():
external_api = self.get_public_proxy('bugs/')
bug_dict = dict(
- product='firefox', summary='the summary', comment='the comment')
+ product='firefox', summary='the summary',
+ comment='the comment')
result = external_api.filebug(bug_dict)
self.assertStartsWith(result, 'http://bugs.launchpad.dev/bugs/')
References