Merge lp:~cjwatson/launchpad/quieten-tests into lp:launchpad
- quieten-tests
- Merge into devel
Proposed by
Colin Watson
Status: | Merged |
---|---|
Merged at revision: | 18383 |
Proposed branch: | lp:~cjwatson/launchpad/quieten-tests |
Merge into: | lp:launchpad |
Diff against target: |
447 lines (+55/-25) 14 files modified
lib/lp/app/tests/test_services.py (+4/-1) lib/lp/blueprints/browser/tests/test_specification.py (+3/-1) lib/lp/bugs/model/tests/test_bugtask.py (+4/-4) lib/lp/code/browser/tests/test_branch.py (+3/-1) lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+5/-1) lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py (+4/-1) lib/lp/registry/browser/tests/test_packaging.py (+3/-6) lib/lp/registry/browser/tests/test_person.py (+6/-3) lib/lp/registry/browser/tests/test_reassign_team_view.py (+3/-1) lib/lp/services/features/browser/tests/test_feature_editor.py (+6/-1) lib/lp/services/webapp/tests/test_publication.py (+4/-1) lib/lp/translations/browser/tests/test_distribution_views.py (+3/-1) lib/lp/translations/scripts/tests/test_remove_translations.py (+4/-2) lib/lp/translations/tests/test_autoapproval.py (+3/-1) |
To merge this branch: | bzr merge lp:~cjwatson/launchpad/quieten-tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+323918@code.launchpad.net |
Commit message
Quieten some tests with noisy output.
Description of the change
To post a comment you must log in.
Revision history for this message
William Grant (wgrant) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/app/tests/test_services.py' | |||
2 | --- lib/lp/app/tests/test_services.py 2015-07-08 16:05:11 +0000 | |||
3 | +++ lib/lp/app/tests/test_services.py 2017-05-11 14:53:15 +0000 | |||
4 | @@ -1,8 +1,9 @@ | |||
6 | 1 | # Copyright 2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012-2017 Canonical Ltd. This software is licensed under the |
7 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
8 | 3 | 3 | ||
9 | 4 | """Tests for core services infrastructure.""" | 4 | """Tests for core services infrastructure.""" |
10 | 5 | 5 | ||
11 | 6 | from fixtures import FakeLogger | ||
12 | 6 | from lazr.restful.interfaces._rest import IHTTPResource | 7 | from lazr.restful.interfaces._rest import IHTTPResource |
13 | 7 | from zope.component import getUtility | 8 | from zope.component import getUtility |
14 | 8 | from zope.interface import implementer | 9 | from zope.interface import implementer |
15 | @@ -49,12 +50,14 @@ | |||
16 | 49 | 50 | ||
17 | 50 | def test_invalid_traversal(self): | 51 | def test_invalid_traversal(self): |
18 | 51 | # Test that traversal to +services without a service specified fails. | 52 | # Test that traversal to +services without a service specified fails. |
19 | 53 | self.useFixture(FakeLogger()) | ||
20 | 52 | self.assertRaises( | 54 | self.assertRaises( |
21 | 53 | NotFound, self.getUserBrowser, | 55 | NotFound, self.getUserBrowser, |
22 | 54 | 'https://launchpad.dev/api/devel/+services') | 56 | 'https://launchpad.dev/api/devel/+services') |
23 | 55 | 57 | ||
24 | 56 | def test_invalid_service(self): | 58 | def test_invalid_service(self): |
25 | 57 | # Test that traversal an invalid service name fails. | 59 | # Test that traversal an invalid service name fails. |
26 | 60 | self.useFixture(FakeLogger()) | ||
27 | 58 | self.assertRaises( | 61 | self.assertRaises( |
28 | 59 | NotFound, self.getUserBrowser, | 62 | NotFound, self.getUserBrowser, |
29 | 60 | 'https://launchpad.dev/api/devel/+services/invalid') | 63 | 'https://launchpad.dev/api/devel/+services/invalid') |
30 | 61 | 64 | ||
31 | === modified file 'lib/lp/blueprints/browser/tests/test_specification.py' | |||
32 | --- lib/lp/blueprints/browser/tests/test_specification.py 2015-06-25 07:39:40 +0000 | |||
33 | +++ lib/lp/blueprints/browser/tests/test_specification.py 2017-05-11 14:53:15 +0000 | |||
34 | @@ -1,4 +1,4 @@ | |||
36 | 1 | # Copyright 2009-2013 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the |
37 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
38 | 3 | 3 | ||
39 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
40 | @@ -9,6 +9,7 @@ | |||
41 | 9 | import unittest | 9 | import unittest |
42 | 10 | 10 | ||
43 | 11 | from BeautifulSoup import BeautifulSoup | 11 | from BeautifulSoup import BeautifulSoup |
44 | 12 | from fixtures import FakeLogger | ||
45 | 12 | from lazr.restful.interfaces import IJSONRequestCache | 13 | from lazr.restful.interfaces import IJSONRequestCache |
46 | 13 | import pytz | 14 | import pytz |
47 | 14 | import soupmatchers | 15 | import soupmatchers |
48 | @@ -187,6 +188,7 @@ | |||
49 | 187 | def test_private_specification_without_authorization(self): | 188 | def test_private_specification_without_authorization(self): |
50 | 188 | # Users without access get a 404 when trying to view private | 189 | # Users without access get a 404 when trying to view private |
51 | 189 | # specifications. | 190 | # specifications. |
52 | 191 | self.useFixture(FakeLogger()) | ||
53 | 190 | owner = self.factory.makePerson() | 192 | owner = self.factory.makePerson() |
54 | 191 | policy = SpecificationSharingPolicy.PROPRIETARY | 193 | policy = SpecificationSharingPolicy.PROPRIETARY |
55 | 192 | product = self.factory.makeProduct(owner=owner, | 194 | product = self.factory.makeProduct(owner=owner, |
56 | 193 | 195 | ||
57 | === modified file 'lib/lp/bugs/model/tests/test_bugtask.py' | |||
58 | --- lib/lp/bugs/model/tests/test_bugtask.py 2016-05-05 08:23:13 +0000 | |||
59 | +++ lib/lp/bugs/model/tests/test_bugtask.py 2017-05-11 14:53:15 +0000 | |||
60 | @@ -1,4 +1,4 @@ | |||
62 | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the |
63 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
64 | 3 | 3 | ||
65 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
66 | @@ -84,7 +84,7 @@ | |||
67 | 84 | ) | 84 | ) |
68 | 85 | from lp.services.features.testing import FeatureFixture | 85 | from lp.services.features.testing import FeatureFixture |
69 | 86 | from lp.services.job.tests import block_on_job | 86 | from lp.services.job.tests import block_on_job |
71 | 87 | from lp.services.log.logger import FakeLogger | 87 | from lp.services.log.logger import DevNullLogger |
72 | 88 | from lp.services.propertycache import get_property_cache | 88 | from lp.services.propertycache import get_property_cache |
73 | 89 | from lp.services.searchbuilder import any | 89 | from lp.services.searchbuilder import any |
74 | 90 | from lp.services.webapp.authorization import check_permission | 90 | from lp.services.webapp.authorization import check_permission |
75 | @@ -3154,7 +3154,7 @@ | |||
76 | 3154 | "/var/lock/launchpad-launchpad-targetnamecacheupdater.lock"))) | 3154 | "/var/lock/launchpad-launchpad-targetnamecacheupdater.lock"))) |
77 | 3155 | self.assertTrue('INFO Updating targetname cache of bugtasks' in err) | 3155 | self.assertTrue('INFO Updating targetname cache of bugtasks' in err) |
78 | 3156 | self.assertTrue('INFO Calculating targets.' in err) | 3156 | self.assertTrue('INFO Calculating targets.' in err) |
80 | 3157 | self.assertTrue('INFO Will check ', err) | 3157 | self.assertTrue('INFO Will check ' in err) |
81 | 3158 | self.assertTrue("INFO Updating (u'Mozilla Thunderbird',)" in err) | 3158 | self.assertTrue("INFO Updating (u'Mozilla Thunderbird',)" in err) |
82 | 3159 | self.assertTrue('INFO Updated 1 target names.' in err) | 3159 | self.assertTrue('INFO Updated 1 target names.' in err) |
83 | 3160 | self.assertTrue('INFO Finished updating targetname cache' in err) | 3160 | self.assertTrue('INFO Finished updating targetname cache' in err) |
84 | @@ -3218,7 +3218,7 @@ | |||
85 | 3218 | self.assertEqual(upstream_task.bugtargetdisplayname, | 3218 | self.assertEqual(upstream_task.bugtargetdisplayname, |
86 | 3219 | u'Mozilla Thunderbird NG') | 3219 | u'Mozilla Thunderbird NG') |
87 | 3220 | 3220 | ||
89 | 3221 | logger = FakeLogger() | 3221 | logger = DevNullLogger() |
90 | 3222 | updater = BugTaskTargetNameCacheUpdater(transaction, logger) | 3222 | updater = BugTaskTargetNameCacheUpdater(transaction, logger) |
91 | 3223 | updater.run() | 3223 | updater.run() |
92 | 3224 | 3224 | ||
93 | 3225 | 3225 | ||
94 | === modified file 'lib/lp/code/browser/tests/test_branch.py' | |||
95 | --- lib/lp/code/browser/tests/test_branch.py 2016-11-11 14:24:38 +0000 | |||
96 | +++ lib/lp/code/browser/tests/test_branch.py 2017-05-11 14:53:15 +0000 | |||
97 | @@ -1,4 +1,4 @@ | |||
99 | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the |
100 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
101 | 3 | 3 | ||
102 | 4 | """Unit tests for BranchView.""" | 4 | """Unit tests for BranchView.""" |
103 | @@ -9,6 +9,7 @@ | |||
104 | 9 | from textwrap import dedent | 9 | from textwrap import dedent |
105 | 10 | 10 | ||
106 | 11 | from BeautifulSoup import BeautifulSoup | 11 | from BeautifulSoup import BeautifulSoup |
107 | 12 | from fixtures import FakeLogger | ||
108 | 12 | import pytz | 13 | import pytz |
109 | 13 | from storm.store import Store | 14 | from storm.store import Store |
110 | 14 | from testtools.matchers import Equals | 15 | from testtools.matchers import Equals |
111 | @@ -664,6 +665,7 @@ | |||
112 | 664 | 665 | ||
113 | 665 | def test_anonymous_view_branch_with_private_owner(self): | 666 | def test_anonymous_view_branch_with_private_owner(self): |
114 | 666 | # A branch with a private owner is not rendered for anon users. | 667 | # A branch with a private owner is not rendered for anon users. |
115 | 668 | self.useFixture(FakeLogger()) | ||
116 | 667 | private_owner = self.factory.makeTeam( | 669 | private_owner = self.factory.makeTeam( |
117 | 668 | visibility=PersonVisibility.PRIVATE) | 670 | visibility=PersonVisibility.PRIVATE) |
118 | 669 | with person_logged_in(private_owner): | 671 | with person_logged_in(private_owner): |
119 | 670 | 672 | ||
120 | === modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py' | |||
121 | --- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-10-14 16:16:18 +0000 | |||
122 | +++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2017-05-11 14:53:15 +0000 | |||
123 | @@ -1,4 +1,4 @@ | |||
125 | 1 | # Copyright 2010-2016 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2017 Canonical Ltd. This software is licensed under the |
126 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
127 | 3 | 3 | ||
128 | 4 | """Tests for the source package recipe view classes and templates.""" | 4 | """Tests for the source package recipe view classes and templates.""" |
129 | @@ -14,6 +14,7 @@ | |||
130 | 14 | from textwrap import dedent | 14 | from textwrap import dedent |
131 | 15 | 15 | ||
132 | 16 | from BeautifulSoup import BeautifulSoup | 16 | from BeautifulSoup import BeautifulSoup |
133 | 17 | from fixtures import FakeLogger | ||
134 | 17 | from mechanize import LinkNotFoundError | 18 | from mechanize import LinkNotFoundError |
135 | 18 | from pytz import UTC | 19 | from pytz import UTC |
136 | 19 | from testtools.matchers import Equals | 20 | from testtools.matchers import Equals |
137 | @@ -390,6 +391,7 @@ | |||
138 | 390 | layer = DatabaseFunctionalLayer | 391 | layer = DatabaseFunctionalLayer |
139 | 391 | 392 | ||
140 | 392 | def test_create_new_recipe_not_logged_in(self): | 393 | def test_create_new_recipe_not_logged_in(self): |
141 | 394 | self.useFixture(FakeLogger()) | ||
142 | 393 | product = self.factory.makeProduct( | 395 | product = self.factory.makeProduct( |
143 | 394 | name='ratatouille', displayname='Ratatouille') | 396 | name='ratatouille', displayname='Ratatouille') |
144 | 395 | branch = self.makeBranch( | 397 | branch = self.makeBranch( |
145 | @@ -1576,6 +1578,7 @@ | |||
146 | 1576 | 1578 | ||
147 | 1577 | def test_request_builds_action_not_logged_in(self): | 1579 | def test_request_builds_action_not_logged_in(self): |
148 | 1578 | """Requesting a build creates pending builds.""" | 1580 | """Requesting a build creates pending builds.""" |
149 | 1581 | self.useFixture(FakeLogger()) | ||
150 | 1579 | self._makeWoodyDistroSeries() | 1582 | self._makeWoodyDistroSeries() |
151 | 1580 | recipe = self.makeRecipe() | 1583 | recipe = self.makeRecipe() |
152 | 1581 | browser = self.getViewBrowser(recipe, no_login=True) | 1584 | browser = self.getViewBrowser(recipe, no_login=True) |
153 | @@ -1927,6 +1930,7 @@ | |||
154 | 1927 | browser.url) | 1930 | browser.url) |
155 | 1928 | 1931 | ||
156 | 1929 | def test_delete_recipe_no_permissions(self): | 1932 | def test_delete_recipe_no_permissions(self): |
157 | 1933 | self.useFixture(FakeLogger()) | ||
158 | 1930 | branch = self.makeBranch() | 1934 | branch = self.makeBranch() |
159 | 1931 | recipe = self.factory.makeSourcePackageRecipe( | 1935 | recipe = self.factory.makeSourcePackageRecipe( |
160 | 1932 | owner=self.chef, branches=[branch]) | 1936 | owner=self.chef, branches=[branch]) |
161 | 1933 | 1937 | ||
162 | === modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py' | |||
163 | --- lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py 2015-09-11 14:23:02 +0000 | |||
164 | +++ lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py 2017-05-11 14:53:15 +0000 | |||
165 | @@ -1,9 +1,10 @@ | |||
167 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2017 Canonical Ltd. This software is licensed under the |
168 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
169 | 3 | """Tests for the source package recipe view classes and templates.""" | 3 | """Tests for the source package recipe view classes and templates.""" |
170 | 4 | 4 | ||
171 | 5 | __metaclass__ = type | 5 | __metaclass__ = type |
172 | 6 | 6 | ||
173 | 7 | from fixtures import FakeLogger | ||
174 | 7 | from mechanize import LinkNotFoundError | 8 | from mechanize import LinkNotFoundError |
175 | 8 | from storm.locals import Store | 9 | from storm.locals import Store |
176 | 9 | from testtools.matchers import StartsWith | 10 | from testtools.matchers import StartsWith |
177 | @@ -112,6 +113,7 @@ | |||
178 | 112 | 113 | ||
179 | 113 | def test_cancel_build_not_owner(self): | 114 | def test_cancel_build_not_owner(self): |
180 | 114 | """A normal user can't cancel a build.""" | 115 | """A normal user can't cancel a build.""" |
181 | 116 | self.useFixture(FakeLogger()) | ||
182 | 115 | queue = self.factory.makeSourcePackageRecipeBuild().queueBuild() | 117 | queue = self.factory.makeSourcePackageRecipeBuild().queueBuild() |
183 | 116 | build = queue.specific_build | 118 | build = queue.specific_build |
184 | 117 | transaction.commit() | 119 | transaction.commit() |
185 | @@ -195,6 +197,7 @@ | |||
186 | 195 | 197 | ||
187 | 196 | def test_rescore_build_not_admin(self): | 198 | def test_rescore_build_not_admin(self): |
188 | 197 | """No one but admin can rescore a build.""" | 199 | """No one but admin can rescore a build.""" |
189 | 200 | self.useFixture(FakeLogger()) | ||
190 | 198 | queue = self.factory.makeSourcePackageRecipeBuild().queueBuild() | 201 | queue = self.factory.makeSourcePackageRecipeBuild().queueBuild() |
191 | 199 | build = queue.specific_build | 202 | build = queue.specific_build |
192 | 200 | transaction.commit() | 203 | transaction.commit() |
193 | 201 | 204 | ||
194 | === modified file 'lib/lp/registry/browser/tests/test_packaging.py' | |||
195 | --- lib/lp/registry/browser/tests/test_packaging.py 2016-09-09 16:51:36 +0000 | |||
196 | +++ lib/lp/registry/browser/tests/test_packaging.py 2017-05-11 14:53:15 +0000 | |||
197 | @@ -1,4 +1,4 @@ | |||
199 | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the |
200 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
201 | 3 | 3 | ||
202 | 4 | """Browser tests for Packaging actions.""" | 4 | """Browser tests for Packaging actions.""" |
203 | @@ -25,10 +25,7 @@ | |||
204 | 25 | logout, | 25 | logout, |
205 | 26 | TestCaseWithFactory, | 26 | TestCaseWithFactory, |
206 | 27 | ) | 27 | ) |
211 | 28 | from lp.testing.layers import ( | 28 | from lp.testing.layers import DatabaseFunctionalLayer |
208 | 29 | DatabaseFunctionalLayer, | ||
209 | 30 | PageTestLayer, | ||
210 | 31 | ) | ||
212 | 32 | from lp.testing.pages import setupBrowser | 29 | from lp.testing.pages import setupBrowser |
213 | 33 | from lp.testing.views import create_initialized_view | 30 | from lp.testing.views import create_initialized_view |
214 | 34 | 31 | ||
215 | @@ -152,7 +149,7 @@ | |||
216 | 152 | class TestBrowserDeletePackaging(TestCaseWithFactory): | 149 | class TestBrowserDeletePackaging(TestCaseWithFactory): |
217 | 153 | """Browser tests for deletion of Packaging objects.""" | 150 | """Browser tests for deletion of Packaging objects.""" |
218 | 154 | 151 | ||
220 | 155 | layer = PageTestLayer | 152 | layer = DatabaseFunctionalLayer |
221 | 156 | 153 | ||
222 | 157 | def setUp(self): | 154 | def setUp(self): |
223 | 158 | super(TestBrowserDeletePackaging, self).setUp() | 155 | super(TestBrowserDeletePackaging, self).setUp() |
224 | 159 | 156 | ||
225 | === modified file 'lib/lp/registry/browser/tests/test_person.py' | |||
226 | --- lib/lp/registry/browser/tests/test_person.py 2017-04-22 13:13:22 +0000 | |||
227 | +++ lib/lp/registry/browser/tests/test_person.py 2017-05-11 14:53:15 +0000 | |||
228 | @@ -8,6 +8,7 @@ | |||
229 | 8 | import re | 8 | import re |
230 | 9 | from textwrap import dedent | 9 | from textwrap import dedent |
231 | 10 | 10 | ||
232 | 11 | from fixtures import FakeLogger | ||
233 | 11 | import soupmatchers | 12 | import soupmatchers |
234 | 12 | from storm.store import Store | 13 | from storm.store import Store |
235 | 13 | from testtools.matchers import ( | 14 | from testtools.matchers import ( |
236 | @@ -44,7 +45,7 @@ | |||
237 | 44 | from lp.services.config import config | 45 | from lp.services.config import config |
238 | 45 | from lp.services.identity.interfaces.account import AccountStatus | 46 | from lp.services.identity.interfaces.account import AccountStatus |
239 | 46 | from lp.services.identity.interfaces.emailaddress import IEmailAddressSet | 47 | from lp.services.identity.interfaces.emailaddress import IEmailAddressSet |
241 | 47 | from lp.services.log.logger import FakeLogger | 48 | from lp.services.log.logger import DevNullLogger |
242 | 48 | from lp.services.mail import stub | 49 | from lp.services.mail import stub |
243 | 49 | from lp.services.propertycache import clear_property_cache | 50 | from lp.services.propertycache import clear_property_cache |
244 | 50 | from lp.services.verification.interfaces.authtoken import LoginTokenType | 51 | from lp.services.verification.interfaces.authtoken import LoginTokenType |
245 | @@ -747,6 +748,7 @@ | |||
246 | 747 | 748 | ||
247 | 748 | def test_team_editemails_not_found(self): | 749 | def test_team_editemails_not_found(self): |
248 | 749 | """Teams should not have a +editemails page.""" | 750 | """Teams should not have a +editemails page.""" |
249 | 751 | self.useFixture(FakeLogger()) | ||
250 | 750 | team = self.factory.makeTeam(owner=self.person, members=[self.person]) | 752 | team = self.factory.makeTeam(owner=self.person, members=[self.person]) |
251 | 751 | url = '%s/+editemails' % canonical_url(team) | 753 | url = '%s/+editemails' % canonical_url(team) |
252 | 752 | browser = setupBrowserForUser(user=self.person) | 754 | browser = setupBrowserForUser(user=self.person) |
253 | @@ -754,6 +756,7 @@ | |||
254 | 754 | 756 | ||
255 | 755 | def test_team_editmailinglists_not_found(self): | 757 | def test_team_editmailinglists_not_found(self): |
256 | 756 | """Teams should not have a +editmailinglists page.""" | 758 | """Teams should not have a +editmailinglists page.""" |
257 | 759 | self.useFixture(FakeLogger()) | ||
258 | 757 | team = self.factory.makeTeam(owner=self.person, members=[self.person]) | 760 | team = self.factory.makeTeam(owner=self.person, members=[self.person]) |
259 | 758 | url = '%s/+editmailinglists' % canonical_url(team) | 761 | url = '%s/+editmailinglists' % canonical_url(team) |
260 | 759 | browser = setupBrowserForUser(user=self.person) | 762 | browser = setupBrowserForUser(user=self.person) |
261 | @@ -998,7 +1001,7 @@ | |||
262 | 998 | spphs.append(spph) | 1001 | spphs.append(spph) |
263 | 999 | # Update the releases cache table. | 1002 | # Update the releases cache table. |
264 | 1000 | switch_dbuser('garbo_frequently') | 1003 | switch_dbuser('garbo_frequently') |
266 | 1001 | job = PopulateLatestPersonSourcePackageReleaseCache(FakeLogger()) | 1004 | job = PopulateLatestPersonSourcePackageReleaseCache(DevNullLogger()) |
267 | 1002 | while not job.isDone(): | 1005 | while not job.isDone(): |
268 | 1003 | job(chunk_size=100) | 1006 | job(chunk_size=100) |
269 | 1004 | switch_dbuser('launchpad') | 1007 | switch_dbuser('launchpad') |
270 | @@ -1258,7 +1261,7 @@ | |||
271 | 1258 | self.build.updateStatus(BuildStatus.FAILEDTOBUILD) | 1261 | self.build.updateStatus(BuildStatus.FAILEDTOBUILD) |
272 | 1259 | # Update the releases cache table. | 1262 | # Update the releases cache table. |
273 | 1260 | switch_dbuser('garbo_frequently') | 1263 | switch_dbuser('garbo_frequently') |
275 | 1261 | job = PopulateLatestPersonSourcePackageReleaseCache(FakeLogger()) | 1264 | job = PopulateLatestPersonSourcePackageReleaseCache(DevNullLogger()) |
276 | 1262 | while not job.isDone(): | 1265 | while not job.isDone(): |
277 | 1263 | job(chunk_size=100) | 1266 | job(chunk_size=100) |
278 | 1264 | switch_dbuser('launchpad') | 1267 | switch_dbuser('launchpad') |
279 | 1265 | 1268 | ||
280 | === modified file 'lib/lp/registry/browser/tests/test_reassign_team_view.py' | |||
281 | --- lib/lp/registry/browser/tests/test_reassign_team_view.py 2012-12-10 13:43:47 +0000 | |||
282 | +++ lib/lp/registry/browser/tests/test_reassign_team_view.py 2017-05-11 14:53:15 +0000 | |||
283 | @@ -1,10 +1,11 @@ | |||
285 | 1 | # Copyright 2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2011-2017 Canonical Ltd. This software is licensed under the |
286 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
287 | 3 | 3 | ||
288 | 4 | """Tests for TeamReassignmentView view code.""" | 4 | """Tests for TeamReassignmentView view code.""" |
289 | 5 | 5 | ||
290 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
291 | 7 | 7 | ||
292 | 8 | from fixtures import FakeLogger | ||
293 | 8 | from zope.component import getUtility | 9 | from zope.component import getUtility |
294 | 9 | from zope.security.interfaces import Unauthorized | 10 | from zope.security.interfaces import Unauthorized |
295 | 10 | from zope.security.proxy import removeSecurityProxy | 11 | from zope.security.proxy import removeSecurityProxy |
296 | @@ -31,6 +32,7 @@ | |||
297 | 31 | 32 | ||
298 | 32 | def test_non_owner_unauthorised(self): | 33 | def test_non_owner_unauthorised(self): |
299 | 33 | # Only team owners can reassign team ownership. | 34 | # Only team owners can reassign team ownership. |
300 | 35 | self.useFixture(FakeLogger()) | ||
301 | 34 | team = self.factory.makeTeam() | 36 | team = self.factory.makeTeam() |
302 | 35 | any_person = self.factory.makePerson() | 37 | any_person = self.factory.makePerson() |
303 | 36 | reassign_url = canonical_url(team, view_name='+reassign') | 38 | reassign_url = canonical_url(team, view_name='+reassign') |
304 | 37 | 39 | ||
305 | === modified file 'lib/lp/services/features/browser/tests/test_feature_editor.py' | |||
306 | --- lib/lp/services/features/browser/tests/test_feature_editor.py 2014-02-27 05:26:26 +0000 | |||
307 | +++ lib/lp/services/features/browser/tests/test_feature_editor.py 2017-05-11 14:53:15 +0000 | |||
308 | @@ -1,4 +1,4 @@ | |||
310 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2017 Canonical Ltd. This software is licensed under the |
311 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
312 | 3 | 3 | ||
313 | 4 | """Tests for feature rule editor""" | 4 | """Tests for feature rule editor""" |
314 | @@ -7,6 +7,7 @@ | |||
315 | 7 | 7 | ||
316 | 8 | from textwrap import dedent | 8 | from textwrap import dedent |
317 | 9 | 9 | ||
318 | 10 | from fixtures import FakeLogger | ||
319 | 10 | from testtools.matchers import Equals | 11 | from testtools.matchers import Equals |
320 | 11 | from zope.component import getUtility | 12 | from zope.component import getUtility |
321 | 12 | from zope.security.interfaces import Unauthorized | 13 | from zope.security.interfaces import Unauthorized |
322 | @@ -39,6 +40,10 @@ | |||
323 | 39 | 40 | ||
324 | 40 | layer = DatabaseFunctionalLayer | 41 | layer = DatabaseFunctionalLayer |
325 | 41 | 42 | ||
326 | 43 | def setUp(self): | ||
327 | 44 | super(TestFeatureControlPage, self).setUp() | ||
328 | 45 | self.useFixture(FakeLogger()) | ||
329 | 46 | |||
330 | 42 | def getUserBrowserAsTeamMember(self, teams): | 47 | def getUserBrowserAsTeamMember(self, teams): |
331 | 43 | """Make a TestBrowser authenticated as a team member. | 48 | """Make a TestBrowser authenticated as a team member. |
332 | 44 | 49 | ||
333 | 45 | 50 | ||
334 | === modified file 'lib/lp/services/webapp/tests/test_publication.py' | |||
335 | --- lib/lp/services/webapp/tests/test_publication.py 2016-01-26 15:14:01 +0000 | |||
336 | +++ lib/lp/services/webapp/tests/test_publication.py 2017-05-11 14:53:15 +0000 | |||
337 | @@ -1,4 +1,4 @@ | |||
339 | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the |
340 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
341 | 3 | 3 | ||
342 | 4 | """Tests publication.py""" | 4 | """Tests publication.py""" |
343 | @@ -13,6 +13,7 @@ | |||
344 | 13 | OAuthSignatureMethod_PLAINTEXT, | 13 | OAuthSignatureMethod_PLAINTEXT, |
345 | 14 | OAuthToken, | 14 | OAuthToken, |
346 | 15 | ) | 15 | ) |
347 | 16 | from fixtures import FakeLogger | ||
348 | 16 | from storm.database import ( | 17 | from storm.database import ( |
349 | 17 | STATE_DISCONNECTED, | 18 | STATE_DISCONNECTED, |
350 | 18 | STATE_RECONNECT, | 19 | STATE_RECONNECT, |
351 | @@ -282,6 +283,7 @@ | |||
352 | 282 | def test_not_found(self): | 283 | def test_not_found(self): |
353 | 283 | # No oopses are reported when accessing the referer while rendering | 284 | # No oopses are reported when accessing the referer while rendering |
354 | 284 | # the page. | 285 | # the page. |
355 | 286 | self.useFixture(FakeLogger()) | ||
356 | 285 | browser = self.getUserBrowser() | 287 | browser = self.getUserBrowser() |
357 | 286 | browser.addHeader('Referer', '/whut\xe7foo') | 288 | browser.addHeader('Referer', '/whut\xe7foo') |
358 | 287 | self.assertRaises( | 289 | self.assertRaises( |
359 | @@ -298,6 +300,7 @@ | |||
360 | 298 | def test_non_ascii_url(self): | 300 | def test_non_ascii_url(self): |
361 | 299 | # No oopses are reported when accessing the URL while rendering the | 301 | # No oopses are reported when accessing the URL while rendering the |
362 | 300 | # page. | 302 | # page. |
363 | 303 | self.useFixture(FakeLogger()) | ||
364 | 301 | browser = self.getUserBrowser() | 304 | browser = self.getUserBrowser() |
365 | 302 | self.assertRaises( | 305 | self.assertRaises( |
366 | 303 | NotFound, | 306 | NotFound, |
367 | 304 | 307 | ||
368 | === modified file 'lib/lp/translations/browser/tests/test_distribution_views.py' | |||
369 | --- lib/lp/translations/browser/tests/test_distribution_views.py 2012-01-01 02:58:52 +0000 | |||
370 | +++ lib/lp/translations/browser/tests/test_distribution_views.py 2017-05-11 14:53:15 +0000 | |||
371 | @@ -1,10 +1,11 @@ | |||
373 | 1 | # Copyright 2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2011-2017 Canonical Ltd. This software is licensed under the |
374 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
375 | 3 | 3 | ||
376 | 4 | """Tests for the translations views on a distroseries.""" | 4 | """Tests for the translations views on a distroseries.""" |
377 | 5 | 5 | ||
378 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
379 | 7 | 7 | ||
380 | 8 | from fixtures import FakeLogger | ||
381 | 8 | from zope.security.interfaces import Unauthorized | 9 | from zope.security.interfaces import Unauthorized |
382 | 9 | 10 | ||
383 | 10 | from lp.services.webapp import canonical_url | 11 | from lp.services.webapp import canonical_url |
384 | @@ -38,6 +39,7 @@ | |||
385 | 38 | def test_unprivileged_users(self): | 39 | def test_unprivileged_users(self): |
386 | 39 | # Unprivileged users cannot access distribution translation settings | 40 | # Unprivileged users cannot access distribution translation settings |
387 | 40 | # page Distribution:+configure-translations. | 41 | # page Distribution:+configure-translations. |
388 | 42 | self.useFixture(FakeLogger()) | ||
389 | 41 | unprivileged = self.factory.makePerson() | 43 | unprivileged = self.factory.makePerson() |
390 | 42 | distribution = self.factory.makeDistribution() | 44 | distribution = self.factory.makeDistribution() |
391 | 43 | browser = self.getUserBrowser(user=unprivileged) | 45 | browser = self.getUserBrowser(user=unprivileged) |
392 | 44 | 46 | ||
393 | === modified file 'lib/lp/translations/scripts/tests/test_remove_translations.py' | |||
394 | --- lib/lp/translations/scripts/tests/test_remove_translations.py 2014-12-08 23:42:47 +0000 | |||
395 | +++ lib/lp/translations/scripts/tests/test_remove_translations.py 2017-05-11 14:53:15 +0000 | |||
396 | @@ -1,6 +1,6 @@ | |||
397 | 1 | #! /usr/bin/python | 1 | #! /usr/bin/python |
398 | 2 | # | 2 | # |
400 | 3 | # Copyright 2009 Canonical Ltd. This software is licensed under the | 3 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the |
401 | 4 | # GNU Affero General Public License version 3 (see the file LICENSE). | 4 | # GNU Affero General Public License version 3 (see the file LICENSE). |
402 | 5 | 5 | ||
403 | 6 | """Test `remove_translations` and the `RemoveTranslations` script.""" | 6 | """Test `remove_translations` and the `RemoveTranslations` script.""" |
404 | @@ -21,6 +21,7 @@ | |||
405 | 21 | from zope.testing.loghandler import Handler | 21 | from zope.testing.loghandler import Handler |
406 | 22 | 22 | ||
407 | 23 | from lp.registry.interfaces.person import IPersonSet | 23 | from lp.registry.interfaces.person import IPersonSet |
408 | 24 | from lp.services.log.logger import DevNullLogger | ||
409 | 24 | from lp.services.scripts.base import LaunchpadScriptFailure | 25 | from lp.services.scripts.base import LaunchpadScriptFailure |
410 | 25 | from lp.testing import ( | 26 | from lp.testing import ( |
411 | 26 | TestCase, | 27 | TestCase, |
412 | @@ -46,7 +47,8 @@ | |||
413 | 46 | """Create a `RemoveTranslations` script with given options.""" | 47 | """Create a `RemoveTranslations` script with given options.""" |
414 | 47 | if isinstance(args, basestring): | 48 | if isinstance(args, basestring): |
415 | 48 | args = [args] | 49 | args = [args] |
417 | 49 | script = RemoveTranslations('remove-translations-test', test_args=args) | 50 | script = RemoveTranslations( |
418 | 51 | 'remove-translations-test', test_args=args, logger=DevNullLogger()) | ||
419 | 50 | return script | 52 | return script |
420 | 51 | 53 | ||
421 | 52 | 54 | ||
422 | 53 | 55 | ||
423 | === modified file 'lib/lp/translations/tests/test_autoapproval.py' | |||
424 | --- lib/lp/translations/tests/test_autoapproval.py 2013-06-20 05:50:00 +0000 | |||
425 | +++ lib/lp/translations/tests/test_autoapproval.py 2017-05-11 14:53:15 +0000 | |||
426 | @@ -1,4 +1,4 @@ | |||
428 | 1 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2017 Canonical Ltd. This software is licensed under the |
429 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
430 | 3 | 3 | ||
431 | 4 | """Unit tests for translation import queue auto-approval. | 4 | """Unit tests for translation import queue auto-approval. |
432 | @@ -14,6 +14,7 @@ | |||
433 | 14 | timedelta, | 14 | timedelta, |
434 | 15 | ) | 15 | ) |
435 | 16 | 16 | ||
436 | 17 | from fixtures import FakeLogger | ||
437 | 17 | from pytz import UTC | 18 | from pytz import UTC |
438 | 18 | from zope.component import getUtility | 19 | from zope.component import getUtility |
439 | 19 | from zope.security.proxy import removeSecurityProxy | 20 | from zope.security.proxy import removeSecurityProxy |
440 | @@ -308,6 +309,7 @@ | |||
441 | 308 | 309 | ||
442 | 309 | def setUp(self): | 310 | def setUp(self): |
443 | 310 | super(TestTemplateGuess, self).setUp() | 311 | super(TestTemplateGuess, self).setUp() |
444 | 312 | self.useFixture(FakeLogger()) | ||
445 | 311 | self.templateset = POTemplateSet() | 313 | self.templateset = POTemplateSet() |
446 | 312 | 314 | ||
447 | 313 | def _setUpProduct(self): | 315 | def _setUpProduct(self): |