Merge ~cjwatson/launchpad:pyupgrade-py3-soyuz into launchpad:master
- Git
- lp:~cjwatson/launchpad
- pyupgrade-py3-soyuz
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 14807bb7894c836bd00455eb7485b7f6731135c5 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:pyupgrade-py3-soyuz |
Merge into: | launchpad:master |
Diff against target: |
3602 lines (+400/-425) 111 files modified
.git-blame-ignore-revs (+2/-0) .pre-commit-config.yaml (+1/-0) lib/lp/soyuz/adapters/overrides.py (+3/-3) lib/lp/soyuz/adapters/tests/test_archivedependencies.py (+1/-1) lib/lp/soyuz/adapters/tests/test_buildarch.py (+1/-1) lib/lp/soyuz/adapters/tests/test_packagelocation.py (+7/-7) lib/lp/soyuz/browser/archive.py (+10/-10) lib/lp/soyuz/browser/archivepermission.py (+1/-1) lib/lp/soyuz/browser/archivesubscription.py (+5/-5) lib/lp/soyuz/browser/build.py (+1/-1) lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py (+2/-2) lib/lp/soyuz/browser/livefs.py (+8/-8) lib/lp/soyuz/browser/livefsbuild.py (+1/-1) lib/lp/soyuz/browser/packagerelationship.py (+2/-2) lib/lp/soyuz/browser/publishing.py (+5/-5) lib/lp/soyuz/browser/sourceslist.py (+1/-1) lib/lp/soyuz/browser/tests/test_archive.py (+1/-1) lib/lp/soyuz/browser/tests/test_archive_admin_view.py (+1/-1) lib/lp/soyuz/browser/tests/test_archive_packages.py (+3/-3) lib/lp/soyuz/browser/tests/test_archive_webservice.py (+3/-3) lib/lp/soyuz/browser/tests/test_archivesubscription.py (+1/-1) lib/lp/soyuz/browser/tests/test_breadcrumbs.py (+2/-2) lib/lp/soyuz/browser/tests/test_build_views.py (+1/-1) lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py (+1/-1) lib/lp/soyuz/browser/tests/test_distroarchseries_view.py (+1/-1) lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py (+1/-1) lib/lp/soyuz/browser/tests/test_livefs.py (+6/-6) lib/lp/soyuz/browser/tests/test_livefsbuild.py (+3/-3) lib/lp/soyuz/browser/tests/test_publishing.py (+1/-1) lib/lp/soyuz/browser/tests/test_queue.py (+1/-1) lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py (+1/-1) lib/lp/soyuz/interfaces/archive.py (+8/-10) lib/lp/soyuz/interfaces/distributionjob.py (+2/-2) lib/lp/soyuz/interfaces/livefs.py (+6/-6) lib/lp/soyuz/interfaces/publishing.py (+6/-6) lib/lp/soyuz/interfaces/queue.py (+4/-4) lib/lp/soyuz/mail/binarypackagebuild.py (+5/-8) lib/lp/soyuz/mail/livefsbuild.py (+3/-4) lib/lp/soyuz/mail/packageupload.py (+9/-13) lib/lp/soyuz/mail/tests/test_packageupload.py (+12/-12) lib/lp/soyuz/model/archive.py (+13/-13) lib/lp/soyuz/model/archivedependency.py (+1/-1) lib/lp/soyuz/model/archivefile.py (+1/-1) lib/lp/soyuz/model/archivejob.py (+4/-5) lib/lp/soyuz/model/archivepermission.py (+3/-4) lib/lp/soyuz/model/binaryandsourcepackagename.py (+1/-2) lib/lp/soyuz/model/binarypackagebuildbehaviour.py (+1/-2) lib/lp/soyuz/model/binarypackagename.py (+0/-1) lib/lp/soyuz/model/binarypackagerelease.py (+2/-2) lib/lp/soyuz/model/binarysourcereference.py (+1/-1) lib/lp/soyuz/model/distributionjob.py (+2/-2) lib/lp/soyuz/model/distroarchseriesfilter.py (+1/-1) lib/lp/soyuz/model/initializedistroseriesjob.py (+3/-4) lib/lp/soyuz/model/livefs.py (+1/-1) lib/lp/soyuz/model/livefsbuild.py (+3/-3) lib/lp/soyuz/model/livefsbuildbehaviour.py (+1/-2) lib/lp/soyuz/model/packagecopyjob.py (+5/-5) lib/lp/soyuz/model/packagediff.py (+1/-2) lib/lp/soyuz/model/packageset.py (+2/-2) lib/lp/soyuz/model/processacceptedbugsjob.py (+1/-1) lib/lp/soyuz/model/publishing.py (+7/-8) lib/lp/soyuz/model/queue.py (+4/-5) lib/lp/soyuz/model/sourcepackagerelease.py (+1/-1) lib/lp/soyuz/scripts/custom_uploads_copier.py (+1/-3) lib/lp/soyuz/scripts/ftpmasterbase.py (+0/-2) lib/lp/soyuz/scripts/gina/handlers.py (+1/-3) lib/lp/soyuz/scripts/gina/runner.py (+1/-1) lib/lp/soyuz/scripts/packagecopier.py (+1/-2) lib/lp/soyuz/scripts/populate_archive.py (+1/-1) lib/lp/soyuz/scripts/ppareport.py (+1/-1) lib/lp/soyuz/scripts/retrydepwait.py (+1/-1) lib/lp/soyuz/scripts/tests/test_copypackage.py (+16/-16) lib/lp/soyuz/scripts/tests/test_expire_archive_files.py (+4/-4) lib/lp/soyuz/scripts/tests/test_gina.py (+2/-2) lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py (+80/-80) lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py (+1/-1) lib/lp/soyuz/scripts/tests/test_populatearchive.py (+8/-8) lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py (+1/-1) lib/lp/soyuz/scripts/tests/test_retrydepwait.py (+2/-2) lib/lp/soyuz/tests/test_archive.py (+17/-18) lib/lp/soyuz/tests/test_archive_subscriptions.py (+2/-2) lib/lp/soyuz/tests/test_binaryandsourcepackagename.py (+1/-1) lib/lp/soyuz/tests/test_binarypackagebuild.py (+6/-6) lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py (+2/-2) lib/lp/soyuz/tests/test_binarypackagename.py (+1/-1) lib/lp/soyuz/tests/test_binarysourcereference.py (+1/-1) lib/lp/soyuz/tests/test_build.py (+1/-1) lib/lp/soyuz/tests/test_build_depwait.py (+1/-1) lib/lp/soyuz/tests/test_build_notify.py (+1/-1) lib/lp/soyuz/tests/test_build_privacy.py (+1/-1) lib/lp/soyuz/tests/test_build_set.py (+5/-5) lib/lp/soyuz/tests/test_build_start_estimation.py (+1/-1) lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py (+2/-2) lib/lp/soyuz/tests/test_distroseriesbinarypackage.py (+1/-1) lib/lp/soyuz/tests/test_distroseriesdifferencejob.py (+1/-1) lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py (+1/-1) lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py (+1/-1) lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py (+2/-2) lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py (+1/-1) lib/lp/soyuz/tests/test_hasbuildrecords.py (+7/-7) lib/lp/soyuz/tests/test_livefs.py (+3/-3) lib/lp/soyuz/tests/test_livefsbuild.py (+4/-4) lib/lp/soyuz/tests/test_livefsbuildbehaviour.py (+1/-1) lib/lp/soyuz/tests/test_packagecopyjob.py (+3/-3) lib/lp/soyuz/tests/test_packageset.py (+5/-5) lib/lp/soyuz/tests/test_packageupload.py (+4/-4) lib/lp/soyuz/tests/test_processacceptedbugsjob.py (+3/-3) lib/lp/soyuz/tests/test_publishing.py (+5/-5) lib/lp/soyuz/tests/test_publishing_models.py (+1/-1) lib/lp/soyuz/wsgi/tests/test_archiveauth.py (+1/-1) lib/lp/soyuz/xmlrpc/tests/test_archive.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+413916@code.launchpad.net |
Commit message
lp.soyuz: Apply "pyupgrade --py3-plus"
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs |
2 | index c6458be..7b39f1f 100644 |
3 | --- a/.git-blame-ignore-revs |
4 | +++ b/.git-blame-ignore-revs |
5 | @@ -42,3 +42,5 @@ fbed83f22424df8fa5647349493f78937a520db5 |
6 | f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb4465 |
7 | # apply pyupgrade --py3-plus to lp.snappy |
8 | 2cda038936743a2f9271953c23b9fcc98968db63 |
9 | +# apply pyupgrade --py3-plus to lp.soyuz |
10 | +21fb5364d9371c0ad2edf41fa6920c4e16ead2b0 |
11 | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml |
12 | index d70d934..d969ed2 100644 |
13 | --- a/.pre-commit-config.yaml |
14 | +++ b/.pre-commit-config.yaml |
15 | @@ -56,6 +56,7 @@ repos: |
16 | |scripts |
17 | |services |
18 | |snappy |
19 | + |soyuz |
20 | )/ |
21 | - repo: https://github.com/PyCQA/isort |
22 | rev: 5.9.2 |
23 | diff --git a/lib/lp/soyuz/adapters/overrides.py b/lib/lp/soyuz/adapters/overrides.py |
24 | index 3f93f64..f78c769 100644 |
25 | --- a/lib/lp/soyuz/adapters/overrides.py |
26 | +++ b/lib/lp/soyuz/adapters/overrides.py |
27 | @@ -127,7 +127,7 @@ class BinaryOverride(Override): |
28 | def __init__(self, component=None, section=None, priority=None, |
29 | phased_update_percentage=None, version=None, new=None, |
30 | source_override=None): |
31 | - super(BinaryOverride, self).__init__( |
32 | + super().__init__( |
33 | component=component, section=section, version=version, new=new) |
34 | self.priority = priority |
35 | self.phased_update_percentage = phased_update_percentage |
36 | @@ -201,7 +201,7 @@ class BaseOverridePolicy: |
37 | |
38 | def __init__(self, archive, distroseries, pocket, |
39 | phased_update_percentage=None): |
40 | - super(BaseOverridePolicy, self).__init__() |
41 | + super().__init__() |
42 | self.archive = archive |
43 | self.distroseries = distroseries |
44 | self.pocket = pocket |
45 | @@ -226,7 +226,7 @@ class FromExistingOverridePolicy(BaseOverridePolicy): |
46 | def __init__(self, *args, **kwargs): |
47 | self.any_arch = kwargs.pop('any_arch', False) |
48 | self.include_deleted = kwargs.pop('include_deleted', False) |
49 | - super(FromExistingOverridePolicy, self).__init__(*args, **kwargs) |
50 | + super().__init__(*args, **kwargs) |
51 | |
52 | def getExistingPublishingStatuses(self, include_deleted): |
53 | status = list(active_publishing_status) |
54 | diff --git a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py |
55 | index a6374a5..5f49b53 100644 |
56 | --- a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py |
57 | +++ b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py |
58 | @@ -139,7 +139,7 @@ class TestSourcesList(TestCaseWithFactory): |
59 | } |
60 | |
61 | def setUp(self): |
62 | - super(TestSourcesList, self).setUp() |
63 | + super().setUp() |
64 | self.publisher = SoyuzTestPublisher() |
65 | self.ubuntu = getUtility(IDistributionSet).getByName("ubuntu") |
66 | self.hoary = self.ubuntu.getSeries("hoary") |
67 | diff --git a/lib/lp/soyuz/adapters/tests/test_buildarch.py b/lib/lp/soyuz/adapters/tests/test_buildarch.py |
68 | index 1427127..50d7bc3 100644 |
69 | --- a/lib/lp/soyuz/adapters/tests/test_buildarch.py |
70 | +++ b/lib/lp/soyuz/adapters/tests/test_buildarch.py |
71 | @@ -17,7 +17,7 @@ from lp.testing.fixture import CaptureTimeline |
72 | class TestDpkgArchitectureCache(TestCase): |
73 | |
74 | def setUp(self): |
75 | - super(TestDpkgArchitectureCache, self).setUp() |
76 | + super().setUp() |
77 | self.timeline = self.useFixture(CaptureTimeline()).timeline |
78 | |
79 | def assertTimeline(self, expected_details): |
80 | diff --git a/lib/lp/soyuz/adapters/tests/test_packagelocation.py b/lib/lp/soyuz/adapters/tests/test_packagelocation.py |
81 | index 62ac744..3d45f14 100644 |
82 | --- a/lib/lp/soyuz/adapters/tests/test_packagelocation.py |
83 | +++ b/lib/lp/soyuz/adapters/tests/test_packagelocation.py |
84 | @@ -84,8 +84,8 @@ class TestPackageLocation(TestCaseWithFactory): |
85 | self.assertEqual([], location.packagesets) |
86 | |
87 | def testSetupLocationWithPackagesets(self): |
88 | - packageset_name1 = u"foo-packageset" |
89 | - packageset_name2 = u"bar-packageset" |
90 | + packageset_name1 = "foo-packageset" |
91 | + packageset_name2 = "bar-packageset" |
92 | packageset1 = self.factory.makePackageset(name=packageset_name1) |
93 | packageset2 = self.factory.makePackageset(name=packageset_name2) |
94 | location = self.getPackageLocation( |
95 | @@ -138,17 +138,17 @@ class TestPackageLocation(TestCaseWithFactory): |
96 | PackageLocationError, |
97 | self.getPackageLocation, |
98 | distribution_name='debian', |
99 | - packageset_names=[u"unknown"]) |
100 | + packageset_names=["unknown"]) |
101 | |
102 | def test_build_package_location_when_one_packageset_unknown(self): |
103 | """Test that with one of two packagesets unknown.""" |
104 | - packageset_name = u"foo-packageset" |
105 | + packageset_name = "foo-packageset" |
106 | self.factory.makePackageset(name=packageset_name) |
107 | self.assertRaises( |
108 | PackageLocationError, |
109 | self.getPackageLocation, |
110 | distribution_name='debian', |
111 | - packageset_names=[packageset_name, u"unknown"]) |
112 | + packageset_names=[packageset_name, "unknown"]) |
113 | |
114 | def testSetupLocationPPANotMatchingDistribution(self): |
115 | """`PackageLocationError` is raised when PPA does not match the |
116 | @@ -247,9 +247,9 @@ class TestPackageLocation(TestCaseWithFactory): |
117 | self.assertEqual( |
118 | str(location_ubuntu_partner), 'ubuntu/partner: hoary-RELEASE') |
119 | |
120 | - self.factory.makePackageset(name=u"foo-packageset") |
121 | + self.factory.makePackageset(name="foo-packageset") |
122 | location_ubuntu_packageset = self.getPackageLocation( |
123 | - packageset_names=[u"foo-packageset"]) |
124 | + packageset_names=["foo-packageset"]) |
125 | self.assertEqual( |
126 | str(location_ubuntu_packageset), |
127 | 'ubuntu: hoary-RELEASE [foo-packageset]') |
128 | diff --git a/lib/lp/soyuz/browser/archive.py b/lib/lp/soyuz/browser/archive.py |
129 | index 05066a0..90c5b6e 100644 |
130 | --- a/lib/lp/soyuz/browser/archive.py |
131 | +++ b/lib/lp/soyuz/browser/archive.py |
132 | @@ -218,7 +218,7 @@ class DistributionArchiveURL: |
133 | |
134 | @property |
135 | def path(self): |
136 | - return u"+archive/%s" % self.context.name |
137 | + return "+archive/%s" % self.context.name |
138 | |
139 | |
140 | @implementer(ICanonicalUrlData) |
141 | @@ -235,7 +235,7 @@ class PPAURL: |
142 | |
143 | @property |
144 | def path(self): |
145 | - return u"+archive/%s/%s" % ( |
146 | + return "+archive/%s/%s" % ( |
147 | self.context.distribution.name, self.context.name) |
148 | |
149 | |
150 | @@ -651,7 +651,7 @@ class ArchiveViewBase(LaunchpadView, SourcesListEntriesWidget): |
151 | " Since this archive is private, no builds are " |
152 | "being dispatched.") |
153 | self.request.response.addNotification(structured(notification)) |
154 | - super(ArchiveViewBase, self).initialize() |
155 | + super().initialize() |
156 | # Set properties for SourcesListEntriesWidget. |
157 | self.archive = self.context |
158 | self.sources_list_user = self.user |
159 | @@ -948,7 +948,7 @@ class ArchiveView(ArchiveSourcePackageListViewBase): |
160 | self.request.response.redirect( |
161 | canonical_url(self.context.distribution)) |
162 | return |
163 | - super(ArchiveView, self).initialize() |
164 | + super().initialize() |
165 | |
166 | @property |
167 | def displayname_edit_widget(self): |
168 | @@ -1150,7 +1150,7 @@ class ArchiveSourceSelectionFormView(ArchiveSourcePackageListViewBase): |
169 | # batched_sources) but this itself requires the current values of |
170 | # the filtering widgets. So we setup the widgets, then add the |
171 | # extra field and create its widget too. |
172 | - super(ArchiveSourceSelectionFormView, self).setUpWidgets() |
173 | + super().setUpWidgets() |
174 | |
175 | self.form_fields += self.createSelectedSourcesField() |
176 | |
177 | @@ -2116,12 +2116,12 @@ class ArchiveEditView(BaseArchiveEditView, EnableProcessorsMixin): |
178 | |
179 | See `createEnabledProcessors` method. |
180 | """ |
181 | - super(ArchiveEditView, self).setUpFields() |
182 | + super().setUpFields() |
183 | self.form_fields += self.createEnabledProcessors( |
184 | self.context.available_processors, |
185 | - u"The architectures on which the archive can build. Some " |
186 | - u"architectures are restricted and may only be enabled or " |
187 | - u"disabled by administrators.") |
188 | + "The architectures on which the archive can build. Some " |
189 | + "architectures are restricted and may only be enabled or " |
190 | + "disabled by administrators.") |
191 | |
192 | def validate(self, data): |
193 | if 'processors' in data: |
194 | @@ -2161,7 +2161,7 @@ class ArchiveAdminView(BaseArchiveEditView, EnableProcessorsMixin): |
195 | |
196 | def validate_save(self, action, data): |
197 | """Validate the save action on ArchiveAdminView.""" |
198 | - super(ArchiveAdminView, self).validate_save(action, data) |
199 | + super().validate_save(action, data) |
200 | |
201 | if data.get('private') != self.context.private: |
202 | # The privacy is being switched. |
203 | diff --git a/lib/lp/soyuz/browser/archivepermission.py b/lib/lp/soyuz/browser/archivepermission.py |
204 | index 4459fc1..dde0672 100644 |
205 | --- a/lib/lp/soyuz/browser/archivepermission.py |
206 | +++ b/lib/lp/soyuz/browser/archivepermission.py |
207 | @@ -56,4 +56,4 @@ class ArchivePermissionURL: |
208 | "One of component, sourcepackagename or package set should " |
209 | "be set") |
210 | |
211 | - return u"%s/%s?%s" % (perm_type, username, item) |
212 | + return "%s/%s?%s" % (perm_type, username, item) |
213 | diff --git a/lib/lp/soyuz/browser/archivesubscription.py b/lib/lp/soyuz/browser/archivesubscription.py |
214 | index 24059a3..8cff69b 100644 |
215 | --- a/lib/lp/soyuz/browser/archivesubscription.py |
216 | +++ b/lib/lp/soyuz/browser/archivesubscription.py |
217 | @@ -149,7 +149,7 @@ class ArchiveSubscribersView(LaunchpadFormView): |
218 | canonical_url(self.context)) |
219 | return |
220 | |
221 | - super(ArchiveSubscribersView, self).initialize() |
222 | + super().initialize() |
223 | subscription_set = getUtility(IArchiveSubscriberSet) |
224 | self.subscriptions = subscription_set.getByArchive(self.context) |
225 | self.batchnav = BatchNavigator( |
226 | @@ -207,7 +207,7 @@ class ArchiveSubscribersView(LaunchpadFormView): |
227 | self.setFieldError('date_expires', |
228 | "The expiry date must be in the future.") |
229 | |
230 | - @action(u"Add", name="add", |
231 | + @action("Add", name="add", |
232 | validator="validate_new_subscription") |
233 | def create_subscription(self, action, data): |
234 | """Create a subscription for the supplied user.""" |
235 | @@ -272,7 +272,7 @@ class ArchiveSubscriptionEditView(LaunchpadEditFormView): |
236 | "The expiry date must be in the future.") |
237 | |
238 | @action( |
239 | - u'Save', name='update', validator="validate_update_subscription") |
240 | + 'Save', name='update', validator="validate_update_subscription") |
241 | def update_subscription(self, action, data): |
242 | """Update the context subscription with the new data.""" |
243 | # As we present a date selection to the user for expiry, we |
244 | @@ -292,7 +292,7 @@ class ArchiveSubscriptionEditView(LaunchpadEditFormView): |
245 | self.context.subscriber.displayname) |
246 | self.request.response.addNotification(notification) |
247 | |
248 | - @action(u'Revoke access', name='cancel') |
249 | + @action('Revoke access', name='cancel') |
250 | def cancel_subscription(self, action, data): |
251 | """Cancel the context subscription.""" |
252 | self.context.cancel(self.user) |
253 | @@ -371,7 +371,7 @@ class PersonArchiveSubscriptionView(LaunchpadView, SourcesListEntriesWidget): |
254 | |
255 | def initialize(self): |
256 | """Process any posted actions.""" |
257 | - super(PersonArchiveSubscriptionView, self).initialize() |
258 | + super().initialize() |
259 | # Set properties for SourcesListEntriesWidget. |
260 | self.archive = self.context.archive |
261 | self.sources_list_user = self.context.subscriber |
262 | diff --git a/lib/lp/soyuz/browser/build.py b/lib/lp/soyuz/browser/build.py |
263 | index e997277..2ff61ac 100644 |
264 | --- a/lib/lp/soyuz/browser/build.py |
265 | +++ b/lib/lp/soyuz/browser/build.py |
266 | @@ -121,7 +121,7 @@ class BuildUrl: |
267 | |
268 | @property |
269 | def path(self): |
270 | - return u"+build/%d" % self.context.id |
271 | + return "+build/%d" % self.context.id |
272 | |
273 | |
274 | class BuildNavigation(GetitemNavigation, FileNavigationMixin): |
275 | diff --git a/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py b/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py |
276 | index 6cae515..335d278 100644 |
277 | --- a/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py |
278 | +++ b/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py |
279 | @@ -45,5 +45,5 @@ class DistroArchSeriesBinaryPackageReleaseView(LaunchpadView): |
280 | def phased_update_percentage(self): |
281 | """Return the formatted phased update percentage, or empty.""" |
282 | if self.context.phased_update_percentage is not None: |
283 | - return u"%d%% of users" % self.context.phased_update_percentage |
284 | - return u"" |
285 | + return "%d%% of users" % self.context.phased_update_percentage |
286 | + return "" |
287 | diff --git a/lib/lp/soyuz/browser/livefs.py b/lib/lp/soyuz/browser/livefs.py |
288 | index ebfc41f..5409eea 100644 |
289 | --- a/lib/lp/soyuz/browser/livefs.py |
290 | +++ b/lib/lp/soyuz/browser/livefs.py |
291 | @@ -191,12 +191,12 @@ class ILiveFSEditSchema(Interface): |
292 | 'keep_binary_files_days', |
293 | ]) |
294 | distro_series = Choice( |
295 | - vocabulary='BuildableDistroSeries', title=u'Distribution series') |
296 | + vocabulary='BuildableDistroSeries', title='Distribution series') |
297 | metadata = Text( |
298 | - title=u'Live filesystem build metadata', |
299 | + title='Live filesystem build metadata', |
300 | description=( |
301 | - u'A JSON dictionary of data about the image. Entries here will ' |
302 | - 'be passed to the builder.')) |
303 | + 'A JSON dictionary of data about the image. Entries here will ' |
304 | + 'be passed to the builder.')) |
305 | |
306 | |
307 | class LiveFSMetadataValidatorMixin: |
308 | @@ -223,7 +223,7 @@ class LiveFSAddView(LiveFSMetadataValidatorMixin, LaunchpadFormView): |
309 | """See `LaunchpadView`.""" |
310 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): |
311 | raise LiveFSFeatureDisabled |
312 | - super(LiveFSAddView, self).initialize() |
313 | + super().initialize() |
314 | |
315 | @property |
316 | def initial_values(self): |
317 | @@ -249,7 +249,7 @@ class LiveFSAddView(LiveFSMetadataValidatorMixin, LaunchpadFormView): |
318 | self.next_url = canonical_url(livefs) |
319 | |
320 | def validate(self, data): |
321 | - super(LiveFSAddView, self).validate(data) |
322 | + super().validate(data) |
323 | owner = data.get('owner', None) |
324 | distro_series = data['distro_series'] |
325 | name = data.get('name', None) |
326 | @@ -330,11 +330,11 @@ class LiveFSEditView(LiveFSMetadataValidatorMixin, BaseLiveFSEditView): |
327 | """See `LaunchpadEditFormView`.""" |
328 | if 'metadata' in data: |
329 | data['metadata'] = json.loads(data['metadata']) |
330 | - super(LiveFSEditView, self).updateContextFromData( |
331 | + super().updateContextFromData( |
332 | data, context=context, notify_modified=notify_modified) |
333 | |
334 | def validate(self, data): |
335 | - super(LiveFSEditView, self).validate(data) |
336 | + super().validate(data) |
337 | owner = data.get('owner', None) |
338 | distro_series = data['distro_series'] |
339 | name = data.get('name', None) |
340 | diff --git a/lib/lp/soyuz/browser/livefsbuild.py b/lib/lp/soyuz/browser/livefsbuild.py |
341 | index f4b1d93..78c4f1f 100644 |
342 | --- a/lib/lp/soyuz/browser/livefsbuild.py |
343 | +++ b/lib/lp/soyuz/browser/livefsbuild.py |
344 | @@ -150,7 +150,7 @@ class LiveFSBuildRescoreView(LaunchpadFormView): |
345 | |
346 | def __call__(self): |
347 | if self.context.can_be_rescored: |
348 | - return super(LiveFSBuildRescoreView, self).__call__() |
349 | + return super().__call__() |
350 | self.request.response.addWarningNotification( |
351 | "Cannot rescore this build because it is not queued.") |
352 | self.request.response.redirect(canonical_url(self.context)) |
353 | diff --git a/lib/lp/soyuz/browser/packagerelationship.py b/lib/lp/soyuz/browser/packagerelationship.py |
354 | index 9816d03..8123efc 100644 |
355 | --- a/lib/lp/soyuz/browser/packagerelationship.py |
356 | +++ b/lib/lp/soyuz/browser/packagerelationship.py |
357 | @@ -44,8 +44,8 @@ def relationship_builder(relationship_line, getter): |
358 | else: |
359 | url = None |
360 | if rel['version'] is None: |
361 | - operator = u'' |
362 | - version = u'' |
363 | + operator = '' |
364 | + version = '' |
365 | else: |
366 | operator, version = rel['version'] |
367 | relationship_set.add(name, operator, version, url) |
368 | diff --git a/lib/lp/soyuz/browser/publishing.py b/lib/lp/soyuz/browser/publishing.py |
369 | index 86bbb19..a6d16c5 100644 |
370 | --- a/lib/lp/soyuz/browser/publishing.py |
371 | +++ b/lib/lp/soyuz/browser/publishing.py |
372 | @@ -58,14 +58,14 @@ class SourcePublicationURL(PublicationURLBase): |
373 | """Dynamic URL declaration for `ISourcePackagePublishingHistory`""" |
374 | @property |
375 | def path(self): |
376 | - return u"+sourcepub/%s" % self.context.id |
377 | + return "+sourcepub/%s" % self.context.id |
378 | |
379 | |
380 | class BinaryPublicationURL(PublicationURLBase): |
381 | """Dynamic URL declaration for `IBinaryPackagePublishingHistory`""" |
382 | @property |
383 | def path(self): |
384 | - return u"+binarypub/%s" % self.context.id |
385 | + return "+binarypub/%s" % self.context.id |
386 | |
387 | |
388 | class SourcePackagePublishingHistoryNavigation(Navigation, |
389 | @@ -188,7 +188,7 @@ class BasePublishingRecordView(LaunchpadView): |
390 | """Return the removal comment or 'None provided'.""" |
391 | removal_comment = self.context.removal_comment |
392 | if removal_comment is None or not removal_comment.strip(): |
393 | - removal_comment = u'None provided.' |
394 | + removal_comment = 'None provided.' |
395 | |
396 | return removal_comment |
397 | |
398 | @@ -197,8 +197,8 @@ class BasePublishingRecordView(LaunchpadView): |
399 | """Return the formatted phased update percentage, or empty.""" |
400 | if (self.is_binary and |
401 | self.context.phased_update_percentage is not None): |
402 | - return u"%d%% of users" % self.context.phased_update_percentage |
403 | - return u"" |
404 | + return "%d%% of users" % self.context.phased_update_percentage |
405 | + return "" |
406 | |
407 | @property |
408 | def linkify_copied_from_archive(self): |
409 | diff --git a/lib/lp/soyuz/browser/sourceslist.py b/lib/lp/soyuz/browser/sourceslist.py |
410 | index 29697aa..6a63a44 100644 |
411 | --- a/lib/lp/soyuz/browser/sourceslist.py |
412 | +++ b/lib/lp/soyuz/browser/sourceslist.py |
413 | @@ -41,7 +41,7 @@ class SourcesListEntriesView(LaunchpadView): |
414 | comment=None): |
415 | self._initially_without_selection = initially_without_selection |
416 | self.comment = comment |
417 | - super(SourcesListEntriesView, self).__init__(context, request) |
418 | + super().__init__(context, request) |
419 | |
420 | def initialize(self): |
421 | self.terms = [] |
422 | diff --git a/lib/lp/soyuz/browser/tests/test_archive.py b/lib/lp/soyuz/browser/tests/test_archive.py |
423 | index 9ed6c08..07e8614 100644 |
424 | --- a/lib/lp/soyuz/browser/tests/test_archive.py |
425 | +++ b/lib/lp/soyuz/browser/tests/test_archive.py |
426 | @@ -58,7 +58,7 @@ class TestArchiveEditView(TestCaseWithFactory): |
427 | layer = LaunchpadFunctionalLayer |
428 | |
429 | def setUp(self): |
430 | - super(TestArchiveEditView, self).setUp() |
431 | + super().setUp() |
432 | # None of the Ubuntu series in sampledata have amd64. Add it to |
433 | # breezy so that it shows up in the list of available processors. |
434 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
435 | diff --git a/lib/lp/soyuz/browser/tests/test_archive_admin_view.py b/lib/lp/soyuz/browser/tests/test_archive_admin_view.py |
436 | index aecf106..7a2abdf 100644 |
437 | --- a/lib/lp/soyuz/browser/tests/test_archive_admin_view.py |
438 | +++ b/lib/lp/soyuz/browser/tests/test_archive_admin_view.py |
439 | @@ -17,7 +17,7 @@ class TestArchivePrivacySwitchingView(TestCaseWithFactory): |
440 | |
441 | def setUp(self): |
442 | """Create a ppa for the tests and login as an admin.""" |
443 | - super(TestArchivePrivacySwitchingView, self).setUp() |
444 | + super().setUp() |
445 | self.ppa = self.factory.makeArchive() |
446 | # Login as an admin to ensure access to the view's context |
447 | # object. |
448 | diff --git a/lib/lp/soyuz/browser/tests/test_archive_packages.py b/lib/lp/soyuz/browser/tests/test_archive_packages.py |
449 | index db5f7e2..ea6d517 100644 |
450 | --- a/lib/lp/soyuz/browser/tests/test_archive_packages.py |
451 | +++ b/lib/lp/soyuz/browser/tests/test_archive_packages.py |
452 | @@ -54,7 +54,7 @@ class TestP3APackages(TestCaseWithFactory): |
453 | layer = LaunchpadFunctionalLayer |
454 | |
455 | def setUp(self): |
456 | - super(TestP3APackages, self).setUp() |
457 | + super().setUp() |
458 | self.private_ppa = self.factory.makeArchive(description='Foo') |
459 | login('admin@canonical.com') |
460 | self.private_ppa.private = True |
461 | @@ -333,7 +333,7 @@ class TestPPAPackagesJobNotifications(TestCaseWithFactory): |
462 | layer = LaunchpadFunctionalLayer |
463 | |
464 | def setUp(self): |
465 | - super(TestPPAPackagesJobNotifications, self).setUp() |
466 | + super().setUp() |
467 | self.ws_version = 'devel' |
468 | self.person = self.factory.makePerson() |
469 | self.archive = self.factory.makeArchive(owner=self.person) |
470 | @@ -494,7 +494,7 @@ class TestP3APackagesQueryCount(TestCaseWithFactory): |
471 | layer = DatabaseFunctionalLayer |
472 | |
473 | def setUp(self): |
474 | - super(TestP3APackagesQueryCount, self).setUp() |
475 | + super().setUp() |
476 | self.team = self.factory.makeTeam() |
477 | login_person(self.team.teamowner) |
478 | self.person = self.factory.makePerson() |
479 | diff --git a/lib/lp/soyuz/browser/tests/test_archive_webservice.py b/lib/lp/soyuz/browser/tests/test_archive_webservice.py |
480 | index 87a33a2..352b346 100644 |
481 | --- a/lib/lp/soyuz/browser/tests/test_archive_webservice.py |
482 | +++ b/lib/lp/soyuz/browser/tests/test_archive_webservice.py |
483 | @@ -49,7 +49,7 @@ class TestArchiveWebservice(TestCaseWithFactory): |
484 | layer = DatabaseFunctionalLayer |
485 | |
486 | def setUp(self): |
487 | - super(TestArchiveWebservice, self).setUp() |
488 | + super().setUp() |
489 | with admin_logged_in() as _admin: |
490 | admin = _admin |
491 | self.archive = self.factory.makeArchive( |
492 | @@ -682,7 +682,7 @@ class TestGetPublishedBinaries(TestCaseWithFactory): |
493 | layer = DatabaseFunctionalLayer |
494 | |
495 | def setUp(self): |
496 | - super(TestGetPublishedBinaries, self).setUp() |
497 | + super().setUp() |
498 | self.person = self.factory.makePerson() |
499 | self.archive = self.factory.makeArchive() |
500 | self.person_url = api_url(self.person) |
501 | @@ -817,7 +817,7 @@ class TestRemoveCopyNotification(TestCaseWithFactory): |
502 | layer = DatabaseFunctionalLayer |
503 | |
504 | def setUp(self): |
505 | - super(TestRemoveCopyNotification, self).setUp() |
506 | + super().setUp() |
507 | self.person = self.factory.makePerson() |
508 | self.archive = self.factory.makeArchive(owner=self.person) |
509 | self.archive_url = api_url(self.archive) |
510 | diff --git a/lib/lp/soyuz/browser/tests/test_archivesubscription.py b/lib/lp/soyuz/browser/tests/test_archivesubscription.py |
511 | index 24ecb0f..31daf54 100644 |
512 | --- a/lib/lp/soyuz/browser/tests/test_archivesubscription.py |
513 | +++ b/lib/lp/soyuz/browser/tests/test_archivesubscription.py |
514 | @@ -29,7 +29,7 @@ class TestArchiveSubscribersView(TestCaseWithFactory): |
515 | layer = LaunchpadFunctionalLayer |
516 | |
517 | def setUp(self): |
518 | - super(TestArchiveSubscribersView, self).setUp() |
519 | + super().setUp() |
520 | self.p3a_owner = self.factory.makePerson() |
521 | admin = getUtility(IPersonSet).getByEmail('admin@canonical.com') |
522 | with person_logged_in(admin): |
523 | diff --git a/lib/lp/soyuz/browser/tests/test_breadcrumbs.py b/lib/lp/soyuz/browser/tests/test_breadcrumbs.py |
524 | index c3c1789..23875f3 100644 |
525 | --- a/lib/lp/soyuz/browser/tests/test_breadcrumbs.py |
526 | +++ b/lib/lp/soyuz/browser/tests/test_breadcrumbs.py |
527 | @@ -16,7 +16,7 @@ from lp.testing.breadcrumbs import BaseBreadcrumbTestCase |
528 | class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase): |
529 | |
530 | def setUp(self): |
531 | - super(TestDistroArchSeriesBreadcrumb, self).setUp() |
532 | + super().setUp() |
533 | self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu') |
534 | self.hoary = self.ubuntu.getSeries('hoary') |
535 | self.hoary_i386 = self.hoary['i386'] |
536 | @@ -46,7 +46,7 @@ class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase): |
537 | class TestArchiveSubscriptionBreadcrumb(BaseBreadcrumbTestCase): |
538 | |
539 | def setUp(self): |
540 | - super(TestArchiveSubscriptionBreadcrumb, self).setUp() |
541 | + super().setUp() |
542 | |
543 | # Create a private ppa |
544 | self.ppa = self.factory.makeArchive() |
545 | diff --git a/lib/lp/soyuz/browser/tests/test_build_views.py b/lib/lp/soyuz/browser/tests/test_build_views.py |
546 | index 02bb4a1..477a9f6 100644 |
547 | --- a/lib/lp/soyuz/browser/tests/test_build_views.py |
548 | +++ b/lib/lp/soyuz/browser/tests/test_build_views.py |
549 | @@ -45,7 +45,7 @@ class TestBuildViews(TestCaseWithFactory): |
550 | layer = LaunchpadFunctionalLayer |
551 | |
552 | def setUp(self): |
553 | - super(TestBuildViews, self).setUp() |
554 | + super().setUp() |
555 | self.empty_request = LaunchpadTestRequest(form={}) |
556 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
557 | |
558 | diff --git a/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py |
559 | index c33246e..e02d995 100644 |
560 | --- a/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py |
561 | +++ b/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py |
562 | @@ -66,7 +66,7 @@ class TestDistributionSourcePackageReleaseFiles(TestCaseWithFactory): |
563 | layer = LaunchpadFunctionalLayer |
564 | |
565 | def setUp(self): |
566 | - super(TestDistributionSourcePackageReleaseFiles, self).setUp() |
567 | + super().setUp() |
568 | # SourcePackageRelease itself is contextless, so wrap it in DSPR |
569 | # to give it a URL. |
570 | spr = self.factory.makeSourcePackageRelease() |
571 | diff --git a/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py b/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py |
572 | index 4357b71..0e5237b 100644 |
573 | --- a/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py |
574 | +++ b/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py |
575 | @@ -17,7 +17,7 @@ class TestDistroArchSeriesView(TestCaseWithFactory): |
576 | |
577 | def setUp(self): |
578 | """Create a distroarchseries for the tests and login as an admin.""" |
579 | - super(TestDistroArchSeriesView, self).setUp() |
580 | + super().setUp() |
581 | self.das = self.factory.makeDistroArchSeries() |
582 | # Login as an admin to ensure access to the view's context |
583 | # object. |
584 | diff --git a/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py |
585 | index b903fef..e80f847 100644 |
586 | --- a/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py |
587 | +++ b/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py |
588 | @@ -21,7 +21,7 @@ class TestDistroSourcePackageReleaseFiles(TestCaseWithFactory): |
589 | layer = LaunchpadFunctionalLayer |
590 | |
591 | def setUp(self): |
592 | - super(TestDistroSourcePackageReleaseFiles, self).setUp() |
593 | + super().setUp() |
594 | # The package must be published for the page to render. |
595 | stp = SoyuzTestPublisher() |
596 | distroseries = stp.setUpDefaultDistroSeries() |
597 | diff --git a/lib/lp/soyuz/browser/tests/test_livefs.py b/lib/lp/soyuz/browser/tests/test_livefs.py |
598 | index af61b1e..26a020e 100644 |
599 | --- a/lib/lp/soyuz/browser/tests/test_livefs.py |
600 | +++ b/lib/lp/soyuz/browser/tests/test_livefs.py |
601 | @@ -66,7 +66,7 @@ class TestLiveFSNavigation(TestCaseWithFactory): |
602 | layer = DatabaseFunctionalLayer |
603 | |
604 | def setUp(self): |
605 | - super(TestLiveFSNavigation, self).setUp() |
606 | + super().setUp() |
607 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
608 | |
609 | def test_canonical_url(self): |
610 | @@ -138,7 +138,7 @@ class TestLiveFSAddView(BrowserTestCase): |
611 | layer = DatabaseFunctionalLayer |
612 | |
613 | def setUp(self): |
614 | - super(TestLiveFSAddView, self).setUp() |
615 | + super().setUp() |
616 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
617 | self.useFixture(FakeLogger()) |
618 | self.person = self.factory.makePerson( |
619 | @@ -217,7 +217,7 @@ class TestLiveFSAdminView(BrowserTestCase): |
620 | layer = DatabaseFunctionalLayer |
621 | |
622 | def setUp(self): |
623 | - super(TestLiveFSAdminView, self).setUp() |
624 | + super().setUp() |
625 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
626 | self.useFixture(FakeLogger()) |
627 | self.person = self.factory.makePerson( |
628 | @@ -272,7 +272,7 @@ class TestLiveFSEditView(BrowserTestCase): |
629 | layer = DatabaseFunctionalLayer |
630 | |
631 | def setUp(self): |
632 | - super(TestLiveFSEditView, self).setUp() |
633 | + super().setUp() |
634 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
635 | self.useFixture(FakeLogger()) |
636 | self.person = self.factory.makePerson( |
637 | @@ -352,7 +352,7 @@ class TestLiveFSDeleteView(BrowserTestCase): |
638 | layer = LaunchpadFunctionalLayer |
639 | |
640 | def setUp(self): |
641 | - super(TestLiveFSDeleteView, self).setUp() |
642 | + super().setUp() |
643 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
644 | self.person = self.factory.makePerson( |
645 | name="test-person", displayname="Test Person") |
646 | @@ -402,7 +402,7 @@ class TestLiveFSView(BrowserTestCase): |
647 | layer = LaunchpadFunctionalLayer |
648 | |
649 | def setUp(self): |
650 | - super(TestLiveFSView, self).setUp() |
651 | + super().setUp() |
652 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
653 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
654 | self.distroseries = self.factory.makeDistroSeries( |
655 | diff --git a/lib/lp/soyuz/browser/tests/test_livefsbuild.py b/lib/lp/soyuz/browser/tests/test_livefsbuild.py |
656 | index 1998d10..6cd5350 100644 |
657 | --- a/lib/lp/soyuz/browser/tests/test_livefsbuild.py |
658 | +++ b/lib/lp/soyuz/browser/tests/test_livefsbuild.py |
659 | @@ -43,7 +43,7 @@ class TestCanonicalUrlForLiveFSBuild(TestCaseWithFactory): |
660 | layer = DatabaseFunctionalLayer |
661 | |
662 | def setUp(self): |
663 | - super(TestCanonicalUrlForLiveFSBuild, self).setUp() |
664 | + super().setUp() |
665 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
666 | |
667 | def test_canonical_url(self): |
668 | @@ -68,7 +68,7 @@ class TestLiveFSBuildView(TestCaseWithFactory): |
669 | layer = LaunchpadFunctionalLayer |
670 | |
671 | def setUp(self): |
672 | - super(TestLiveFSBuildView, self).setUp() |
673 | + super().setUp() |
674 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
675 | |
676 | def test_files(self): |
677 | @@ -111,7 +111,7 @@ class TestLiveFSBuildOperations(BrowserTestCase): |
678 | layer = DatabaseFunctionalLayer |
679 | |
680 | def setUp(self): |
681 | - super(TestLiveFSBuildOperations, self).setUp() |
682 | + super().setUp() |
683 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
684 | self.useFixture(FakeLogger()) |
685 | self.build = self.factory.makeLiveFSBuild() |
686 | diff --git a/lib/lp/soyuz/browser/tests/test_publishing.py b/lib/lp/soyuz/browser/tests/test_publishing.py |
687 | index 54ad0fc..5d67740 100644 |
688 | --- a/lib/lp/soyuz/browser/tests/test_publishing.py |
689 | +++ b/lib/lp/soyuz/browser/tests/test_publishing.py |
690 | @@ -40,7 +40,7 @@ class TestSourcePublicationListingExtra(BrowserTestCase): |
691 | layer = LaunchpadFunctionalLayer |
692 | |
693 | def setUp(self): |
694 | - super(TestSourcePublicationListingExtra, self).setUp() |
695 | + super().setUp() |
696 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
697 | # Create everything we need to create builds, such as a |
698 | # DistroArchSeries and a builder. |
699 | diff --git a/lib/lp/soyuz/browser/tests/test_queue.py b/lib/lp/soyuz/browser/tests/test_queue.py |
700 | index 1c8109f..012c1b0 100644 |
701 | --- a/lib/lp/soyuz/browser/tests/test_queue.py |
702 | +++ b/lib/lp/soyuz/browser/tests/test_queue.py |
703 | @@ -65,7 +65,7 @@ class TestAcceptRejectQueueUploads(TestCaseWithFactory): |
704 | def setUp(self): |
705 | """Create two new uploads in the new state and a person with |
706 | permission to upload to the partner archive.""" |
707 | - super(TestAcceptRejectQueueUploads, self).setUp() |
708 | + super().setUp() |
709 | login('admin@canonical.com') |
710 | self.test_publisher = SoyuzTestPublisher() |
711 | self.test_publisher.prepareBreezyAutotest() |
712 | diff --git a/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py |
713 | index c0f7a87..bda8b04 100644 |
714 | --- a/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py |
715 | +++ b/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py |
716 | @@ -18,7 +18,7 @@ class TestSourcePackageReleaseView(TestCaseWithFactory): |
717 | layer = DatabaseFunctionalLayer |
718 | |
719 | def setUp(self): |
720 | - super(TestSourcePackageReleaseView, self).setUp() |
721 | + super().setUp() |
722 | self.source_package_release = self.factory.makeSourcePackageRelease() |
723 | |
724 | def test_highlighted_copyright_is_None(self): |
725 | diff --git a/lib/lp/soyuz/interfaces/archive.py b/lib/lp/soyuz/interfaces/archive.py |
726 | index a3de895..fc7db31 100644 |
727 | --- a/lib/lp/soyuz/interfaces/archive.py |
728 | +++ b/lib/lp/soyuz/interfaces/archive.py |
729 | @@ -118,7 +118,7 @@ from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
730 | from lp.soyuz.interfaces.component import IComponent |
731 | |
732 | |
733 | -NAMED_AUTH_TOKEN_FEATURE_FLAG = u"soyuz.named_auth_token.allow_new" |
734 | +NAMED_AUTH_TOKEN_FEATURE_FLAG = "soyuz.named_auth_token.allow_new" |
735 | |
736 | |
737 | @error_status(http.client.BAD_REQUEST) |
738 | @@ -209,7 +209,7 @@ class CannotUploadToArchive(Exception): |
739 | |
740 | def __init__(self, **args): |
741 | """Construct a `CannotUploadToArchive`.""" |
742 | - super(CannotUploadToArchive, self).__init__(self._fmt % args) |
743 | + super().__init__(self._fmt % args) |
744 | |
745 | |
746 | class InvalidPocketForPartnerArchive(CannotUploadToArchive): |
747 | @@ -223,7 +223,7 @@ class CannotUploadToPocket(Exception): |
748 | """Returned when a pocket is closed for uploads.""" |
749 | |
750 | def __init__(self, distroseries, pocket): |
751 | - super(CannotUploadToPocket, self).__init__( |
752 | + super().__init__( |
753 | "Not permitted to upload to the %s pocket in a series in the " |
754 | "'%s' state." % (pocket.name, distroseries.status.name)) |
755 | |
756 | @@ -271,7 +271,7 @@ class NoRightsForComponent(CannotUploadToArchive): |
757 | "Signer is not permitted to upload to the component '%(component)s'.") |
758 | |
759 | def __init__(self, component): |
760 | - super(NoRightsForComponent, self).__init__(component=component.name) |
761 | + super().__init__(component=component.name) |
762 | |
763 | |
764 | class InvalidPocketForPPA(CannotUploadToArchive): |
765 | @@ -286,7 +286,7 @@ class ArchiveDisabled(CannotUploadToArchive): |
766 | _fmt = ("%(archive_name)s is disabled.") |
767 | |
768 | def __init__(self, archive_name): |
769 | - super(ArchiveDisabled, self).__init__(archive_name=archive_name) |
770 | + super().__init__(archive_name=archive_name) |
771 | |
772 | |
773 | class CannotUploadToSeries(CannotUploadToArchive): |
774 | @@ -295,8 +295,7 @@ class CannotUploadToSeries(CannotUploadToArchive): |
775 | _fmt = ("%(distroseries)s is obsolete and will not accept new uploads.") |
776 | |
777 | def __init__(self, distroseries): |
778 | - super(CannotUploadToSeries, self).__init__( |
779 | - distroseries=distroseries.name) |
780 | + super().__init__(distroseries=distroseries.name) |
781 | |
782 | |
783 | @error_status(http.client.BAD_REQUEST) |
784 | @@ -318,8 +317,7 @@ class CannotModifyArchiveProcessor(Exception): |
785 | 'by administrators.') |
786 | |
787 | def __init__(self, processor): |
788 | - super(CannotModifyArchiveProcessor, self).__init__( |
789 | - self._fmt % {'processor': processor.name}) |
790 | + super().__init__(self._fmt % {'processor': processor.name}) |
791 | |
792 | |
793 | @error_status(http.client.CONFLICT) |
794 | @@ -333,7 +331,7 @@ class NamedAuthTokenFeatureDisabled(Unauthorized): |
795 | """Only certain users can create named authorization tokens.""" |
796 | |
797 | def __init__(self): |
798 | - super(NamedAuthTokenFeatureDisabled, self).__init__( |
799 | + super().__init__( |
800 | "You do not have permission to create named authorization tokens") |
801 | |
802 | |
803 | diff --git a/lib/lp/soyuz/interfaces/distributionjob.py b/lib/lp/soyuz/interfaces/distributionjob.py |
804 | index 9095f32..2ff19cd 100644 |
805 | --- a/lib/lp/soyuz/interfaces/distributionjob.py |
806 | +++ b/lib/lp/soyuz/interfaces/distributionjob.py |
807 | @@ -84,7 +84,7 @@ class InitializationPending(Exception): |
808 | """ |
809 | |
810 | def __init__(self, job): |
811 | - super(InitializationPending, self).__init__() |
812 | + super().__init__() |
813 | self.job = job |
814 | |
815 | |
816 | @@ -95,7 +95,7 @@ class InitializationCompleted(Exception): |
817 | """ |
818 | |
819 | def __init__(self, job): |
820 | - super(InitializationCompleted, self).__init__() |
821 | + super().__init__() |
822 | self.job = job |
823 | |
824 | |
825 | diff --git a/lib/lp/soyuz/interfaces/livefs.py b/lib/lp/soyuz/interfaces/livefs.py |
826 | index 5569735..db7f795 100644 |
827 | --- a/lib/lp/soyuz/interfaces/livefs.py |
828 | +++ b/lib/lp/soyuz/interfaces/livefs.py |
829 | @@ -73,8 +73,8 @@ from lp.soyuz.interfaces.archive import IArchive |
830 | from lp.soyuz.interfaces.distroarchseries import IDistroArchSeries |
831 | |
832 | |
833 | -LIVEFS_FEATURE_FLAG = u"soyuz.livefs.allow_new" |
834 | -LIVEFS_WEBHOOKS_FEATURE_FLAG = u"soyuz.livefs.webhooks.enabled" |
835 | +LIVEFS_FEATURE_FLAG = "soyuz.livefs.allow_new" |
836 | +LIVEFS_WEBHOOKS_FEATURE_FLAG = "soyuz.livefs.webhooks.enabled" |
837 | |
838 | |
839 | @error_status(http.client.BAD_REQUEST) |
840 | @@ -82,7 +82,7 @@ class LiveFSBuildAlreadyPending(Exception): |
841 | """A build was requested when an identical build was already pending.""" |
842 | |
843 | def __init__(self): |
844 | - super(LiveFSBuildAlreadyPending, self).__init__( |
845 | + super().__init__( |
846 | "An identical build of this live filesystem image is already " |
847 | "pending.") |
848 | |
849 | @@ -100,7 +100,7 @@ class LiveFSBuildArchiveOwnerMismatch(Forbidden): |
850 | """ |
851 | |
852 | def __init__(self): |
853 | - super(LiveFSBuildArchiveOwnerMismatch, self).__init__( |
854 | + super().__init__( |
855 | "Live filesystem builds against private archives are only " |
856 | "allowed if the live filesystem owner and the archive owner are " |
857 | "equal.") |
858 | @@ -111,7 +111,7 @@ class LiveFSFeatureDisabled(Unauthorized): |
859 | """Only certain users can create new LiveFS-related objects.""" |
860 | |
861 | def __init__(self): |
862 | - super(LiveFSFeatureDisabled, self).__init__( |
863 | + super().__init__( |
864 | "You do not have permission to create new live filesystems or " |
865 | "new live filesystem builds.") |
866 | |
867 | @@ -121,7 +121,7 @@ class DuplicateLiveFSName(Exception): |
868 | """Raised for live filesystems with duplicate name/owner/distroseries.""" |
869 | |
870 | def __init__(self): |
871 | - super(DuplicateLiveFSName, self).__init__( |
872 | + super().__init__( |
873 | "There is already a live filesystem with the same name, owner, " |
874 | "and distroseries.") |
875 | |
876 | diff --git a/lib/lp/soyuz/interfaces/publishing.py b/lib/lp/soyuz/interfaces/publishing.py |
877 | index 16667a6..a1d5dc2 100644 |
878 | --- a/lib/lp/soyuz/interfaces/publishing.py |
879 | +++ b/lib/lp/soyuz/interfaces/publishing.py |
880 | @@ -570,8 +570,8 @@ class ISourcePackagePublishingHistoryEdit(IPublishingEdit): |
881 | # _schema_circular_imports.py. |
882 | @operation_returns_entry(Interface) |
883 | @operation_parameters( |
884 | - new_component=TextLine(title=u"The new component name."), |
885 | - new_section=TextLine(title=u"The new section name.")) |
886 | + new_component=TextLine(title="The new component name."), |
887 | + new_section=TextLine(title="The new section name.")) |
888 | @export_write_operation() |
889 | @call_with(creator=REQUEST_USER) |
890 | @operation_for_version("devel") |
891 | @@ -870,15 +870,15 @@ class IBinaryPackagePublishingHistoryEdit(IPublishingEdit): |
892 | # _schema_circular_imports.py. |
893 | @operation_returns_entry(Interface) |
894 | @operation_parameters( |
895 | - new_component=TextLine(title=u"The new component name."), |
896 | - new_section=TextLine(title=u"The new section name."), |
897 | + new_component=TextLine(title="The new component name."), |
898 | + new_section=TextLine(title="The new section name."), |
899 | # XXX cjwatson 20120619: It would be nice to use copy_field here to |
900 | # save manually looking up the priority name, but it doesn't work in |
901 | # this case: the title is wrong, and tests fail when a string value |
902 | # is passed over the webservice. |
903 | - new_priority=TextLine(title=u"The new priority name."), |
904 | + new_priority=TextLine(title="The new priority name."), |
905 | new_phased_update_percentage=Int( |
906 | - title=u"The new phased update percentage.")) |
907 | + title="The new phased update percentage.")) |
908 | @export_write_operation() |
909 | @call_with(creator=REQUEST_USER) |
910 | @operation_for_version("devel") |
911 | diff --git a/lib/lp/soyuz/interfaces/queue.py b/lib/lp/soyuz/interfaces/queue.py |
912 | index a95c982..3afd574 100644 |
913 | --- a/lib/lp/soyuz/interfaces/queue.py |
914 | +++ b/lib/lp/soyuz/interfaces/queue.py |
915 | @@ -475,8 +475,8 @@ class IPackageUpload(Interface): |
916 | """ |
917 | |
918 | @operation_parameters( |
919 | - new_component=TextLine(title=u"The new component name."), |
920 | - new_section=TextLine(title=u"The new section name.")) |
921 | + new_component=TextLine(title="The new component name."), |
922 | + new_section=TextLine(title="The new section name.")) |
923 | @call_with(allowed_components=None, user=REQUEST_USER) |
924 | @export_write_operation() |
925 | @operation_for_version('devel') |
926 | @@ -505,9 +505,9 @@ class IPackageUpload(Interface): |
927 | |
928 | @operation_parameters( |
929 | changes=List( |
930 | - title=u"A sequence of changes to apply.", |
931 | + title="A sequence of changes to apply.", |
932 | description=( |
933 | - u"Each item may have a 'name' item which specifies the binary " |
934 | + "Each item may have a 'name' item which specifies the binary " |
935 | "package name to override; otherwise, the change applies to " |
936 | "all binaries in the upload. It may also have 'component', " |
937 | "'section', and 'priority' items which replace the " |
938 | diff --git a/lib/lp/soyuz/mail/binarypackagebuild.py b/lib/lp/soyuz/mail/binarypackagebuild.py |
939 | index 4f3eb4f..225c16e 100644 |
940 | --- a/lib/lp/soyuz/mail/binarypackagebuild.py |
941 | +++ b/lib/lp/soyuz/mail/binarypackagebuild.py |
942 | @@ -61,8 +61,7 @@ class BinaryPackageBuildRecipientReason(RecipientReason): |
943 | |
944 | def getReason(self): |
945 | """See `RecipientReason`.""" |
946 | - return MailWrapper(width=72).format( |
947 | - super(BinaryPackageBuildRecipientReason, self).getReason()) |
948 | + return MailWrapper(width=72).format(super().getReason()) |
949 | |
950 | |
951 | class BinaryPackageBuildMailer(BaseMailer): |
952 | @@ -143,7 +142,7 @@ class BinaryPackageBuildMailer(BaseMailer): |
953 | |
954 | def __init__(self, subject, template_name, recipients, from_address, |
955 | build, extra_info=None): |
956 | - super(BinaryPackageBuildMailer, self).__init__( |
957 | + super().__init__( |
958 | subject, template_name, recipients, from_address, |
959 | notification_type="package-build-status") |
960 | self.build = build |
961 | @@ -151,8 +150,7 @@ class BinaryPackageBuildMailer(BaseMailer): |
962 | |
963 | def _getHeaders(self, email, recipient): |
964 | """See `BaseMailer`.""" |
965 | - headers = super(BinaryPackageBuildMailer, self)._getHeaders( |
966 | - email, recipient) |
967 | + headers = super()._getHeaders(email, recipient) |
968 | build = self.build |
969 | headers.update({ |
970 | "X-Launchpad-Archive": build.archive.reference, |
971 | @@ -169,13 +167,12 @@ class BinaryPackageBuildMailer(BaseMailer): |
972 | # The deprecated PPA reference header is included for Ubuntu PPAs to |
973 | # avoid breaking existing consumers. |
974 | if (build.archive.is_ppa and |
975 | - build.archive.distribution.name == u'ubuntu'): |
976 | + build.archive.distribution.name == 'ubuntu'): |
977 | headers["X-Launchpad-PPA"] = get_ppa_reference(build.archive) |
978 | return headers |
979 | |
980 | def _getTemplateParams(self, email, recipient): |
981 | - params = super(BinaryPackageBuildMailer, self)._getTemplateParams( |
982 | - email, recipient) |
983 | + params = super()._getTemplateParams(email, recipient) |
984 | build = self.build |
985 | extra_info = self.extra_info |
986 | |
987 | diff --git a/lib/lp/soyuz/mail/livefsbuild.py b/lib/lp/soyuz/mail/livefsbuild.py |
988 | index f907884..6bfa5e2 100644 |
989 | --- a/lib/lp/soyuz/mail/livefsbuild.py |
990 | +++ b/lib/lp/soyuz/mail/livefsbuild.py |
991 | @@ -33,22 +33,21 @@ class LiveFSBuildMailer(BaseMailer): |
992 | |
993 | def __init__(self, subject, template_name, recipients, from_address, |
994 | build): |
995 | - super(LiveFSBuildMailer, self).__init__( |
996 | + super().__init__( |
997 | subject, template_name, recipients, from_address, |
998 | notification_type="livefs-build-status") |
999 | self.build = build |
1000 | |
1001 | def _getHeaders(self, email, recipient): |
1002 | """See `BaseMailer`.""" |
1003 | - headers = super(LiveFSBuildMailer, self)._getHeaders(email, recipient) |
1004 | + headers = super()._getHeaders(email, recipient) |
1005 | headers["X-Launchpad-Build-State"] = self.build.status.name |
1006 | return headers |
1007 | |
1008 | def _getTemplateParams(self, email, recipient): |
1009 | """See `BaseMailer`.""" |
1010 | build = self.build |
1011 | - params = super(LiveFSBuildMailer, self)._getTemplateParams( |
1012 | - email, recipient) |
1013 | + params = super()._getTemplateParams(email, recipient) |
1014 | params.update({ |
1015 | "archive_tag": build.archive.reference, |
1016 | "build_id": build.id, |
1017 | diff --git a/lib/lp/soyuz/mail/packageupload.py b/lib/lp/soyuz/mail/packageupload.py |
1018 | index 053a052..8224ebf 100644 |
1019 | --- a/lib/lp/soyuz/mail/packageupload.py |
1020 | +++ b/lib/lp/soyuz/mail/packageupload.py |
1021 | @@ -81,8 +81,7 @@ class PackageUploadRecipientReason(RecipientReason): |
1022 | return cls(recipient, recipient, "Announcement", "") |
1023 | |
1024 | def _getTemplateValues(self): |
1025 | - template_values = super( |
1026 | - PackageUploadRecipientReason, self)._getTemplateValues() |
1027 | + template_values = super()._getTemplateValues() |
1028 | template_values["lc_entity_has"] = "you have" |
1029 | if self.recipient != self.subscriber or self.subscriber.is_team: |
1030 | template_values["lc_entity_has"] = ( |
1031 | @@ -92,7 +91,7 @@ class PackageUploadRecipientReason(RecipientReason): |
1032 | def getReason(self): |
1033 | """See `RecipientReason`.""" |
1034 | return MailWrapper(width=72).format( |
1035 | - super(PackageUploadRecipientReason, self).getReason()) |
1036 | + super().getReason()) |
1037 | |
1038 | |
1039 | def debug(logger, msg, *args, **kwargs): |
1040 | @@ -110,7 +109,7 @@ def sanitize_string(s): |
1041 | 'ascii' codec can't decode byte 0xc4 in position 21: ordinal |
1042 | not in range(128) |
1043 | """ |
1044 | - if isinstance(s, six.text_type): |
1045 | + if isinstance(s, str): |
1046 | return s |
1047 | else: |
1048 | return guess_encoding(s) |
1049 | @@ -447,7 +446,7 @@ class PackageUploadMailer(BaseMailer): |
1050 | distroseries, pocket, summary_text=None, changes=None, |
1051 | changesfile_content=None, announce_from_address=None, |
1052 | previous_version=None, logger=None): |
1053 | - super(PackageUploadMailer, self).__init__( |
1054 | + super().__init__( |
1055 | subject, template_name, recipients, from_address, |
1056 | notification_type="package-upload") |
1057 | self.action = action |
1058 | @@ -480,19 +479,17 @@ class PackageUploadMailer(BaseMailer): |
1059 | self.announce_from_address is not None): |
1060 | return self.announce_from_address |
1061 | else: |
1062 | - return super(PackageUploadMailer, self)._getFromAddress( |
1063 | - email, recipient) |
1064 | + return super()._getFromAddress(email, recipient) |
1065 | |
1066 | def _getHeaders(self, email, recipient): |
1067 | """See `BaseMailer`.""" |
1068 | - headers = super(PackageUploadMailer, self)._getHeaders( |
1069 | - email, recipient) |
1070 | + headers = super()._getHeaders(email, recipient) |
1071 | headers['X-Katie'] = 'Launchpad actually' |
1072 | headers['X-Launchpad-Archive'] = self.archive.reference |
1073 | |
1074 | # The deprecated PPA reference header is included for Ubuntu PPAs to |
1075 | # avoid breaking existing consumers. |
1076 | - if self.archive.is_ppa and self.archive.distribution.name == u'ubuntu': |
1077 | + if self.archive.is_ppa and self.archive.distribution.name == 'ubuntu': |
1078 | headers['X-Launchpad-PPA'] = get_ppa_reference(self.archive) |
1079 | |
1080 | # Include a 'X-Launchpad-Component' header with the component and |
1081 | @@ -541,8 +538,7 @@ class PackageUploadMailer(BaseMailer): |
1082 | |
1083 | def _getTemplateParams(self, email, recipient): |
1084 | """See `BaseMailer`.""" |
1085 | - params = super(PackageUploadMailer, self)._getTemplateParams( |
1086 | - email, recipient) |
1087 | + params = super()._getTemplateParams(email, recipient) |
1088 | params.update({ |
1089 | 'STATUS': ACTION_DESCRIPTIONS[self.action], |
1090 | 'SUMMARY': self.summarystring, |
1091 | @@ -612,7 +608,7 @@ class PackageUploadMailer(BaseMailer): |
1092 | |
1093 | def generateEmail(self, email, recipient, force_no_attachments=False): |
1094 | """See `BaseMailer`.""" |
1095 | - ctrl = super(PackageUploadMailer, self).generateEmail( |
1096 | + ctrl = super().generateEmail( |
1097 | email, recipient, force_no_attachments=force_no_attachments) |
1098 | debug(self.logger, "Sent a mail:") |
1099 | debug(self.logger, " Subject: %s" % ctrl.subject) |
1100 | diff --git a/lib/lp/soyuz/mail/tests/test_packageupload.py b/lib/lp/soyuz/mail/tests/test_packageupload.py |
1101 | index 2dc2a7a..ae539e2 100644 |
1102 | --- a/lib/lp/soyuz/mail/tests/test_packageupload.py |
1103 | +++ b/lib/lp/soyuz/mail/tests/test_packageupload.py |
1104 | @@ -48,14 +48,14 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory): |
1105 | def test_mail_from_unicode_names(self): |
1106 | # People with unicode in their names should appear correctly in the |
1107 | # email and not get smashed to ASCII or otherwise transliterated. |
1108 | - creator = self.factory.makePerson(displayname=u"LoĆÆc") |
1109 | + creator = self.factory.makePerson(displayname="LoĆÆc") |
1110 | spr = self.factory.makeSourcePackageRelease(creator=creator) |
1111 | self.factory.makeSourcePackageReleaseFile(sourcepackagerelease=spr) |
1112 | archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY) |
1113 | pocket = PackagePublishingPocket.RELEASE |
1114 | distroseries = self.factory.makeDistroSeries() |
1115 | distroseries.changeslist = "blah@example.com" |
1116 | - blamer = self.factory.makePerson(displayname=u"StƩphane") |
1117 | + blamer = self.factory.makePerson(displayname="StƩphane") |
1118 | mailer = PackageUploadMailer.forAction( |
1119 | "accepted", blamer, spr, [], [], archive, distroseries, pocket) |
1120 | mailer.sendAll() |
1121 | @@ -63,8 +63,8 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory): |
1122 | self.assertEqual(2, len(notifications)) |
1123 | msg = notifications[1].get_payload(0) |
1124 | body = six.ensure_text(msg.get_payload(decode=True)) |
1125 | - self.assertIn(u"Changed-By: LoĆÆc", body) |
1126 | - self.assertIn(u"Signed-By: StƩphane", body) |
1127 | + self.assertIn("Changed-By: LoĆÆc", body) |
1128 | + self.assertIn("Signed-By: StƩphane", body) |
1129 | |
1130 | def test_calculate_subject_customfile(self): |
1131 | lfa = self.factory.makeLibraryFileAlias() |
1132 | @@ -143,7 +143,7 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory): |
1133 | distroseries.changeslist = "blah@example.com" |
1134 | blamer = self.factory.makePerson() |
1135 | from_person = self.factory.makePerson( |
1136 | - email="loic@example.com", displayname=u"LoĆÆc Motƶrhead") |
1137 | + email="loic@example.com", displayname="LoĆÆc Motƶrhead") |
1138 | mailer = PackageUploadMailer.forAction( |
1139 | "accepted", blamer, spr, [], [], archive, distroseries, pocket, |
1140 | announce_from_person=from_person) |
1141 | @@ -215,7 +215,7 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory): |
1142 | pocket = self.factory.getAnyPocket() |
1143 | distroseries = self.factory.makeDistroSeries() |
1144 | person = self.factory.makePerson( |
1145 | - displayname=u'Blamer', email='blamer@example.com') |
1146 | + displayname='Blamer', email='blamer@example.com') |
1147 | mailer = PackageUploadMailer.forAction( |
1148 | "rejected", person, None, [bpr], [], archive, distroseries, pocket, |
1149 | summary_text="Rejected by archive administrator.") |
1150 | @@ -262,7 +262,7 @@ class TestNotification(TestCaseWithFactory): |
1151 | info['maintainer'], |
1152 | ] |
1153 | for field in fields: |
1154 | - self.assertEqual((u'Foo Bar', u'foo.bar@example.com'), field) |
1155 | + self.assertEqual(('Foo Bar', 'foo.bar@example.com'), field) |
1156 | self.assertFalse(info['notify_changed_by']) |
1157 | |
1158 | def test_fetch_information_changes_notify_changed_by(self): |
1159 | @@ -281,21 +281,21 @@ class TestNotification(TestCaseWithFactory): |
1160 | info['maintainer'], |
1161 | ] |
1162 | for field in fields: |
1163 | - self.assertEqual((u'Foo Bar', u'foo.bar@example.com'), field) |
1164 | + self.assertEqual(('Foo Bar', 'foo.bar@example.com'), field) |
1165 | self.assertTrue(info['notify_changed_by']) |
1166 | |
1167 | def test_fetch_information_spr(self): |
1168 | - creator = self.factory.makePerson(displayname=u"foĆø") |
1169 | - maintainer = self.factory.makePerson(displayname=u"bƦr") |
1170 | + creator = self.factory.makePerson(displayname="foĆø") |
1171 | + maintainer = self.factory.makePerson(displayname="bƦr") |
1172 | spr = self.factory.makeSourcePackageRelease( |
1173 | creator=creator, maintainer=maintainer) |
1174 | info = fetch_information(spr, None, None) |
1175 | self.assertEqual(info['date'], spr.dateuploaded) |
1176 | self.assertEqual(info['changelog'], spr.changelog_entry) |
1177 | self.assertEqual( |
1178 | - (u"foĆø", spr.creator.preferredemail.email), info['changedby']) |
1179 | + ("foĆø", spr.creator.preferredemail.email), info['changedby']) |
1180 | self.assertEqual( |
1181 | - (u"bƦr", spr.maintainer.preferredemail.email), info['maintainer']) |
1182 | + ("bƦr", spr.maintainer.preferredemail.email), info['maintainer']) |
1183 | self.assertFalse(info['notify_changed_by']) |
1184 | |
1185 | def test_fetch_information_bprs(self): |
1186 | diff --git a/lib/lp/soyuz/model/archive.py b/lib/lp/soyuz/model/archive.py |
1187 | index 50ed7aa..b3c7798 100644 |
1188 | --- a/lib/lp/soyuz/model/archive.py |
1189 | +++ b/lib/lp/soyuz/model/archive.py |
1190 | @@ -230,10 +230,10 @@ from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease |
1191 | |
1192 | |
1193 | ARCHIVE_REFERENCE_TEMPLATES = { |
1194 | - ArchivePurpose.PRIMARY: u'%(distribution)s', |
1195 | - ArchivePurpose.PPA: u'~%(owner)s/%(distribution)s/%(archive)s', |
1196 | - ArchivePurpose.PARTNER: u'%(distribution)s/%(archive)s', |
1197 | - ArchivePurpose.COPY: u'%(distribution)s/%(archive)s', |
1198 | + ArchivePurpose.PRIMARY: '%(distribution)s', |
1199 | + ArchivePurpose.PPA: '~%(owner)s/%(distribution)s/%(archive)s', |
1200 | + ArchivePurpose.PARTNER: '%(distribution)s/%(archive)s', |
1201 | + ArchivePurpose.COPY: '%(distribution)s/%(archive)s', |
1202 | } |
1203 | |
1204 | |
1205 | @@ -617,7 +617,7 @@ class Archive(SQLBase): |
1206 | SourcePackageName.id) |
1207 | |
1208 | if name is not None: |
1209 | - if isinstance(name, six.string_types): |
1210 | + if isinstance(name, str): |
1211 | if exact_match: |
1212 | clauses.append(SourcePackageName.name == name) |
1213 | else: |
1214 | @@ -1162,7 +1162,7 @@ class Archive(SQLBase): |
1215 | |
1216 | def _addArchiveDependency(self, dependency, pocket, component=None): |
1217 | """See `IArchive`.""" |
1218 | - if isinstance(component, six.string_types): |
1219 | + if isinstance(component, str): |
1220 | try: |
1221 | component = getUtility(IComponentSet)[component] |
1222 | except NotFoundError as e: |
1223 | @@ -1417,9 +1417,9 @@ class Archive(SQLBase): |
1224 | def _checkUpload(self, person, distroseries, sourcepackagename, component, |
1225 | pocket, strict_component=True): |
1226 | """See `IArchive`.""" |
1227 | - if isinstance(component, six.string_types): |
1228 | + if isinstance(component, str): |
1229 | component = getUtility(IComponentSet)[component] |
1230 | - if isinstance(sourcepackagename, six.string_types): |
1231 | + if isinstance(sourcepackagename, str): |
1232 | sourcepackagename = getUtility( |
1233 | ISourcePackageNameSet)[sourcepackagename] |
1234 | reason = self.checkUpload(person, distroseries, sourcepackagename, |
1235 | @@ -1534,7 +1534,7 @@ class Archive(SQLBase): |
1236 | if self.is_ppa: |
1237 | if IComponent.providedBy(component_name): |
1238 | name = component_name.name |
1239 | - elif isinstance(component_name, six.string_types): |
1240 | + elif isinstance(component_name, str): |
1241 | name = component_name |
1242 | else: |
1243 | name = None |
1244 | @@ -1970,7 +1970,7 @@ class Archive(SQLBase): |
1245 | reason = self.checkUploadToPocket(series, pocket, person=person) |
1246 | if reason: |
1247 | # Wrap any forbidden-pocket error in CannotCopy. |
1248 | - raise CannotCopy(six.text_type(reason)) |
1249 | + raise CannotCopy(str(reason)) |
1250 | |
1251 | # Perform the copy, may raise CannotCopy. Don't do any further |
1252 | # permission checking: this method is protected by |
1253 | @@ -2536,14 +2536,14 @@ class ArchiveSet: |
1254 | """See `IArchiveSet`.""" |
1255 | from lp.registry.interfaces.distribution import IDistributionSet |
1256 | |
1257 | - bits = reference.split(u'/') |
1258 | + bits = reference.split('/') |
1259 | if len(bits) < 1: |
1260 | return None |
1261 | - if bits[0].startswith(u'~') or bits[0].startswith(u'ppa:'): |
1262 | + if bits[0].startswith('~') or bits[0].startswith('ppa:'): |
1263 | # PPA reference (~OWNER/DISTRO/ARCHIVE or ppa:OWNER/DISTRO/ARCHIVE) |
1264 | if len(bits) != 3: |
1265 | return None |
1266 | - if bits[0].startswith(u'~'): |
1267 | + if bits[0].startswith('~'): |
1268 | first_bit = bits[0][1:] |
1269 | else: |
1270 | # ppa:OWNER |
1271 | diff --git a/lib/lp/soyuz/model/archivedependency.py b/lib/lp/soyuz/model/archivedependency.py |
1272 | index f880077..5f7b63c 100644 |
1273 | --- a/lib/lp/soyuz/model/archivedependency.py |
1274 | +++ b/lib/lp/soyuz/model/archivedependency.py |
1275 | @@ -53,7 +53,7 @@ class ArchiveDependency(StormBase): |
1276 | component = Reference(component_id, 'Component.id') |
1277 | |
1278 | def __init__(self, parent, dependency, pocket, component=None): |
1279 | - super(ArchiveDependency, self).__init__() |
1280 | + super().__init__() |
1281 | self.parent = parent |
1282 | self.dependency = dependency |
1283 | self.pocket = pocket |
1284 | diff --git a/lib/lp/soyuz/model/archivefile.py b/lib/lp/soyuz/model/archivefile.py |
1285 | index e6b126d..8f4075a 100644 |
1286 | --- a/lib/lp/soyuz/model/archivefile.py |
1287 | +++ b/lib/lp/soyuz/model/archivefile.py |
1288 | @@ -66,7 +66,7 @@ class ArchiveFile(Storm): |
1289 | |
1290 | def __init__(self, archive, container, path, library_file): |
1291 | """Construct an `ArchiveFile`.""" |
1292 | - super(ArchiveFile, self).__init__() |
1293 | + super().__init__() |
1294 | self.archive = archive |
1295 | self.container = container |
1296 | self.path = path |
1297 | diff --git a/lib/lp/soyuz/model/archivejob.py b/lib/lp/soyuz/model/archivejob.py |
1298 | index 3dcaff2..e6785c6 100644 |
1299 | --- a/lib/lp/soyuz/model/archivejob.py |
1300 | +++ b/lib/lp/soyuz/model/archivejob.py |
1301 | @@ -66,7 +66,7 @@ class ArchiveJob(StormBase): |
1302 | :param metadata: the type-specific variables, as a json-compatible |
1303 | dict. |
1304 | """ |
1305 | - super(ArchiveJob, self).__init__() |
1306 | + super().__init__() |
1307 | self.job = Job() |
1308 | self.archive = archive |
1309 | self.job_type = job_type |
1310 | @@ -103,7 +103,7 @@ class ArchiveJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass): |
1311 | |
1312 | def getOopsVars(self): |
1313 | """See `IRunnableJob`.""" |
1314 | - vars = super(ArchiveJobDerived, self).getOopsVars() |
1315 | + vars = super().getOopsVars() |
1316 | vars.extend([ |
1317 | ('archive_id', self.context.archive.id), |
1318 | ('archive_job_id', self.context.id), |
1319 | @@ -128,12 +128,11 @@ class PackageUploadNotificationJob(ArchiveJobDerived): |
1320 | 'packageupload_status': packageupload.status.title, |
1321 | 'summary_text': summary_text, |
1322 | } |
1323 | - return super(PackageUploadNotificationJob, cls).create( |
1324 | - packageupload.archive, metadata) |
1325 | + return super().create(packageupload.archive, metadata) |
1326 | |
1327 | def getOopsVars(self): |
1328 | """See `ArchiveJobDerived`.""" |
1329 | - vars = super(PackageUploadNotificationJob, self).getOopsVars() |
1330 | + vars = super().getOopsVars() |
1331 | vars.extend([ |
1332 | ('packageupload_id', self.metadata['packageupload_id']), |
1333 | ('packageupload_status', self.metadata['packageupload_status']), |
1334 | diff --git a/lib/lp/soyuz/model/archivepermission.py b/lib/lp/soyuz/model/archivepermission.py |
1335 | index 7c816ec..8c06b7c 100644 |
1336 | --- a/lib/lp/soyuz/model/archivepermission.py |
1337 | +++ b/lib/lp/soyuz/model/archivepermission.py |
1338 | @@ -12,7 +12,6 @@ from operator import attrgetter |
1339 | |
1340 | from lazr.enum import DBItem |
1341 | import pytz |
1342 | -import six |
1343 | from storm.expr import Exists |
1344 | from storm.locals import ( |
1345 | And, |
1346 | @@ -106,7 +105,7 @@ class ArchivePermission(StormBase): |
1347 | def __init__(self, archive, permission, person, component=None, |
1348 | sourcepackagename=None, packageset=None, explicit=False, |
1349 | distroseries=None, pocket=None): |
1350 | - super(ArchivePermission, self).__init__() |
1351 | + super().__init__() |
1352 | self.archive = archive |
1353 | self.permission = permission |
1354 | self.person = person |
1355 | @@ -202,7 +201,7 @@ class ArchivePermissionSet: |
1356 | def _nameToComponent(self, component): |
1357 | """Helper to convert a possible string component to IComponent""" |
1358 | try: |
1359 | - if isinstance(component, six.string_types): |
1360 | + if isinstance(component, str): |
1361 | component = getUtility(IComponentSet)[component] |
1362 | return component |
1363 | except NotFoundError: |
1364 | @@ -210,7 +209,7 @@ class ArchivePermissionSet: |
1365 | |
1366 | def _nameToSourcePackageName(self, sourcepackagename): |
1367 | """Helper to convert a possible string name to ISourcePackageName.""" |
1368 | - if isinstance(sourcepackagename, six.string_types): |
1369 | + if isinstance(sourcepackagename, str): |
1370 | sourcepackagename = getUtility( |
1371 | ISourcePackageNameSet)[sourcepackagename] |
1372 | return sourcepackagename |
1373 | diff --git a/lib/lp/soyuz/model/binaryandsourcepackagename.py b/lib/lp/soyuz/model/binaryandsourcepackagename.py |
1374 | index 566beb7..aa09d28 100644 |
1375 | --- a/lib/lp/soyuz/model/binaryandsourcepackagename.py |
1376 | +++ b/lib/lp/soyuz/model/binaryandsourcepackagename.py |
1377 | @@ -58,5 +58,4 @@ class BinaryAndSourcePackageNameVocabulary(NamedStormHugeVocabulary): |
1378 | def getTermByToken(self, token): |
1379 | """See `IVocabularyTokenized`.""" |
1380 | # package names are always lowercase. |
1381 | - super_class = super(BinaryAndSourcePackageNameVocabulary, self) |
1382 | - return super_class.getTermByToken(token.lower()) |
1383 | + return super().getTermByToken(token.lower()) |
1384 | diff --git a/lib/lp/soyuz/model/binarypackagebuildbehaviour.py b/lib/lp/soyuz/model/binarypackagebuildbehaviour.py |
1385 | index fc94d9a..fd6bd96 100644 |
1386 | --- a/lib/lp/soyuz/model/binarypackagebuildbehaviour.py |
1387 | +++ b/lib/lp/soyuz/model/binarypackagebuildbehaviour.py |
1388 | @@ -152,8 +152,7 @@ class BinaryPackageBuildBehaviour(BuildFarmJobBehaviourBase): |
1389 | das = build.distro_arch_series |
1390 | |
1391 | # Build extra arguments. |
1392 | - args = yield super(BinaryPackageBuildBehaviour, self).extraBuildArgs( |
1393 | - logger=logger) |
1394 | + args = yield super().extraBuildArgs(logger=logger) |
1395 | args['arch_indep'] = build.arch_indep |
1396 | args['distribution'] = das.distroseries.distribution.name |
1397 | args['suite'] = das.distroseries.getSuite(build.pocket) |
1398 | diff --git a/lib/lp/soyuz/model/binarypackagename.py b/lib/lp/soyuz/model/binarypackagename.py |
1399 | index 90a7cae..fc2af72 100644 |
1400 | --- a/lib/lp/soyuz/model/binarypackagename.py |
1401 | +++ b/lib/lp/soyuz/model/binarypackagename.py |
1402 | @@ -25,7 +25,6 @@ from lp.soyuz.interfaces.binarypackagename import ( |
1403 | from lp.soyuz.interfaces.publishing import active_publishing_status |
1404 | |
1405 | |
1406 | -@six.python_2_unicode_compatible |
1407 | @implementer(IBinaryPackageName) |
1408 | class BinaryPackageName(SQLBase): |
1409 | _table = 'BinaryPackageName' |
1410 | diff --git a/lib/lp/soyuz/model/binarypackagerelease.py b/lib/lp/soyuz/model/binarypackagerelease.py |
1411 | index 0421e81..7baebb0 100644 |
1412 | --- a/lib/lp/soyuz/model/binarypackagerelease.py |
1413 | +++ b/lib/lp/soyuz/model/binarypackagerelease.py |
1414 | @@ -92,7 +92,7 @@ class BinaryPackageRelease(SQLBase): |
1415 | kwargs['_user_defined_fields'] = simplejson.dumps( |
1416 | kwargs['user_defined_fields']) |
1417 | del kwargs['user_defined_fields'] |
1418 | - super(BinaryPackageRelease, self).__init__(*args, **kwargs) |
1419 | + super().__init__(*args, **kwargs) |
1420 | |
1421 | @cachedproperty |
1422 | def built_using_references(self): |
1423 | @@ -183,7 +183,7 @@ class BinaryPackageReleaseDownloadCount(Storm): |
1424 | count = Int(allow_none=False) |
1425 | |
1426 | def __init__(self, archive, binary_package_release, day, country, count): |
1427 | - super(BinaryPackageReleaseDownloadCount, self).__init__() |
1428 | + super().__init__() |
1429 | self.archive = archive |
1430 | self.binary_package_release = binary_package_release |
1431 | self.day = day |
1432 | diff --git a/lib/lp/soyuz/model/binarysourcereference.py b/lib/lp/soyuz/model/binarysourcereference.py |
1433 | index f5f4cde..653419a 100644 |
1434 | --- a/lib/lp/soyuz/model/binarysourcereference.py |
1435 | +++ b/lib/lp/soyuz/model/binarysourcereference.py |
1436 | @@ -53,7 +53,7 @@ class BinarySourceReference(StormBase): |
1437 | def __init__(self, binary_package_release, source_package_release, |
1438 | reference_type): |
1439 | """Construct a `BinarySourceReference`.""" |
1440 | - super(BinarySourceReference, self).__init__() |
1441 | + super().__init__() |
1442 | self.binary_package_release = binary_package_release |
1443 | self.source_package_release = source_package_release |
1444 | self.reference_type = reference_type |
1445 | diff --git a/lib/lp/soyuz/model/distributionjob.py b/lib/lp/soyuz/model/distributionjob.py |
1446 | index 2fb9da3..1c302bf 100644 |
1447 | --- a/lib/lp/soyuz/model/distributionjob.py |
1448 | +++ b/lib/lp/soyuz/model/distributionjob.py |
1449 | @@ -54,7 +54,7 @@ class DistributionJob(StormBase): |
1450 | metadata = JSON('json_data') |
1451 | |
1452 | def __init__(self, distribution, distroseries, job_type, metadata): |
1453 | - super(DistributionJob, self).__init__() |
1454 | + super().__init__() |
1455 | self.job = Job() |
1456 | self.distribution = distribution |
1457 | self.distroseries = distroseries |
1458 | @@ -100,7 +100,7 @@ class DistributionJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass): |
1459 | |
1460 | def getOopsVars(self): |
1461 | """See `IRunnableJob`.""" |
1462 | - vars = super(DistributionJobDerived, self).getOopsVars() |
1463 | + vars = super().getOopsVars() |
1464 | vars.extend([ |
1465 | ('distribution_id', self.context.distribution.id), |
1466 | ('distroseries_id', self.context.distroseries.id), |
1467 | diff --git a/lib/lp/soyuz/model/distroarchseriesfilter.py b/lib/lp/soyuz/model/distroarchseriesfilter.py |
1468 | index 13e6007..948aed5 100644 |
1469 | --- a/lib/lp/soyuz/model/distroarchseriesfilter.py |
1470 | +++ b/lib/lp/soyuz/model/distroarchseriesfilter.py |
1471 | @@ -69,7 +69,7 @@ class DistroArchSeriesFilter(Storm): |
1472 | def __init__(self, distroarchseries, packageset, sense, creator, |
1473 | date_created=DEFAULT): |
1474 | """Construct a `DistroArchSeriesFilter`.""" |
1475 | - super(DistroArchSeriesFilter, self).__init__() |
1476 | + super().__init__() |
1477 | self.distroarchseries = distroarchseries |
1478 | self.packageset = packageset |
1479 | self.sense = sense |
1480 | diff --git a/lib/lp/soyuz/model/initializedistroseriesjob.py b/lib/lp/soyuz/model/initializedistroseriesjob.py |
1481 | index 0af6d13..dd10c81 100644 |
1482 | --- a/lib/lp/soyuz/model/initializedistroseriesjob.py |
1483 | +++ b/lib/lp/soyuz/model/initializedistroseriesjob.py |
1484 | @@ -5,7 +5,6 @@ __all__ = [ |
1485 | "InitializeDistroSeriesJob", |
1486 | ] |
1487 | |
1488 | -import six |
1489 | from zope.interface import ( |
1490 | implementer, |
1491 | provider, |
1492 | @@ -216,12 +215,12 @@ class InitializeDistroSeriesJob(DistributionJobDerived): |
1493 | """ |
1494 | # This method is called when error is an instance of |
1495 | # self.user_error_types. |
1496 | - super(InitializeDistroSeriesJob, self).notifyUserError(error) |
1497 | + super().notifyUserError(error) |
1498 | self.metadata = dict( |
1499 | - self.metadata, error_description=six.text_type(error)) |
1500 | + self.metadata, error_description=str(error)) |
1501 | |
1502 | def getOopsVars(self): |
1503 | """See `IRunnableJob`.""" |
1504 | - vars = super(InitializeDistroSeriesJob, self).getOopsVars() |
1505 | + vars = super().getOopsVars() |
1506 | vars.append(('parent_distroseries_ids', self.metadata.get("parents"))) |
1507 | return vars |
1508 | diff --git a/lib/lp/soyuz/model/livefs.py b/lib/lp/soyuz/model/livefs.py |
1509 | index 84e765f..ae3a92f 100644 |
1510 | --- a/lib/lp/soyuz/model/livefs.py |
1511 | +++ b/lib/lp/soyuz/model/livefs.py |
1512 | @@ -133,7 +133,7 @@ class LiveFS(Storm, WebhookTargetMixin): |
1513 | """Construct a `LiveFS`.""" |
1514 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): |
1515 | raise LiveFSFeatureDisabled |
1516 | - super(LiveFS, self).__init__() |
1517 | + super().__init__() |
1518 | self.registrant = registrant |
1519 | self.owner = owner |
1520 | self.distro_series = distro_series |
1521 | diff --git a/lib/lp/soyuz/model/livefsbuild.py b/lib/lp/soyuz/model/livefsbuild.py |
1522 | index 7ec3e87..79865ec 100644 |
1523 | --- a/lib/lp/soyuz/model/livefsbuild.py |
1524 | +++ b/lib/lp/soyuz/model/livefsbuild.py |
1525 | @@ -92,7 +92,7 @@ class LiveFSFile(Storm): |
1526 | |
1527 | def __init__(self, livefsbuild, libraryfile): |
1528 | """Construct a `LiveFSFile`.""" |
1529 | - super(LiveFSFile, self).__init__() |
1530 | + super().__init__() |
1531 | self.livefsbuild = livefsbuild |
1532 | self.libraryfile = libraryfile |
1533 | |
1534 | @@ -163,7 +163,7 @@ class LiveFSBuild(PackageBuildMixin, Storm): |
1535 | """Construct a `LiveFSBuild`.""" |
1536 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): |
1537 | raise LiveFSFeatureDisabled |
1538 | - super(LiveFSBuild, self).__init__() |
1539 | + super().__init__() |
1540 | self.build_farm_job = build_farm_job |
1541 | self.requester = requester |
1542 | self.livefs = livefs |
1543 | @@ -303,7 +303,7 @@ class LiveFSBuild(PackageBuildMixin, Storm): |
1544 | |
1545 | edited_fields = set() |
1546 | with notify_modified(self, edited_fields) as previous_obj: |
1547 | - super(LiveFSBuild, self).updateStatus( |
1548 | + super().updateStatus( |
1549 | status, builder=builder, slave_status=slave_status, |
1550 | date_started=date_started, date_finished=date_finished, |
1551 | force_invalid_transition=force_invalid_transition) |
1552 | diff --git a/lib/lp/soyuz/model/livefsbuildbehaviour.py b/lib/lp/soyuz/model/livefsbuildbehaviour.py |
1553 | index 700e5c0..510d17c 100644 |
1554 | --- a/lib/lp/soyuz/model/livefsbuildbehaviour.py |
1555 | +++ b/lib/lp/soyuz/model/livefsbuildbehaviour.py |
1556 | @@ -92,8 +92,7 @@ class LiveFSBuildBehaviour(BuildFarmJobBehaviourBase): |
1557 | Return the extra arguments required by the slave for the given build. |
1558 | """ |
1559 | build = self.build |
1560 | - base_args = yield super(LiveFSBuildBehaviour, self).extraBuildArgs( |
1561 | - logger=logger) |
1562 | + base_args = yield super().extraBuildArgs(logger=logger) |
1563 | # Non-trivial metadata values may have been security-wrapped, which |
1564 | # is pointless here and just gets in the way of xmlrpc.client |
1565 | # serialisation. |
1566 | diff --git a/lib/lp/soyuz/model/packagecopyjob.py b/lib/lp/soyuz/model/packagecopyjob.py |
1567 | index f3a91a8..a3ede41 100644 |
1568 | --- a/lib/lp/soyuz/model/packagecopyjob.py |
1569 | +++ b/lib/lp/soyuz/model/packagecopyjob.py |
1570 | @@ -145,7 +145,7 @@ class PackageCopyJob(StormBase): |
1571 | def __init__(self, source_archive, target_archive, target_distroseries, |
1572 | job_type, metadata, requester, package_name=None, |
1573 | copy_policy=None): |
1574 | - super(PackageCopyJob, self).__init__() |
1575 | + super().__init__() |
1576 | self.job = Job() |
1577 | self.job.requester = requester |
1578 | self.job_type = job_type |
1579 | @@ -228,7 +228,7 @@ class PackageCopyJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass): |
1580 | |
1581 | def getOopsVars(self): |
1582 | """See `IRunnableJob`.""" |
1583 | - vars = super(PackageCopyJobDerived, self).getOopsVars() |
1584 | + vars = super().getOopsVars() |
1585 | vars.extend([ |
1586 | ('source_archive_id', self.context.source_archive_id), |
1587 | ('target_archive_id', self.context.target_archive_id), |
1588 | @@ -581,7 +581,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived): |
1589 | " package. It was logged with id %s. Sorry for the" |
1590 | " inconvenience." % oops["id"]) |
1591 | transaction.commit() |
1592 | - super(PlainPackageCopyJob, self).notifyOops(oops) |
1593 | + super().notifyOops(oops) |
1594 | |
1595 | @property |
1596 | def _advisory_lock_id(self): |
1597 | @@ -624,7 +624,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived): |
1598 | target_archive_purpose = self.target_archive.purpose |
1599 | self.logger.info("Job:\n%s\nraised CannotCopy:\n%s" % (self, e)) |
1600 | self.abort() # Abort the txn. |
1601 | - self.reportFailure(six.text_type(e)) |
1602 | + self.reportFailure(str(e)) |
1603 | |
1604 | # If there is an associated PackageUpload we need to reject it, |
1605 | # else it will sit in ACCEPTED forever. |
1606 | @@ -663,7 +663,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived): |
1607 | person=self.requester) |
1608 | if reason: |
1609 | # Wrap any forbidden-pocket error in CannotCopy. |
1610 | - raise CannotCopy(six.text_type(reason)) |
1611 | + raise CannotCopy(str(reason)) |
1612 | |
1613 | if self.silent and not self.requester_can_admin_target: |
1614 | raise CannotCopy( |
1615 | diff --git a/lib/lp/soyuz/model/packagediff.py b/lib/lp/soyuz/model/packagediff.py |
1616 | index c9ad7a3..90d2170 100644 |
1617 | --- a/lib/lp/soyuz/model/packagediff.py |
1618 | +++ b/lib/lp/soyuz/model/packagediff.py |
1619 | @@ -15,7 +15,6 @@ import shutil |
1620 | import subprocess |
1621 | import tempfile |
1622 | |
1623 | -import six |
1624 | from storm.expr import Desc |
1625 | from storm.store import EmptyResultSet |
1626 | from zope.component import getUtility |
1627 | @@ -215,7 +214,7 @@ class PackageDiff(SQLBase): |
1628 | zip(directions, (self.from_source, self.to_source))) |
1629 | |
1630 | # Iterate over the packages to be diff'ed. |
1631 | - for direction, package in six.iteritems(packages): |
1632 | + for direction, package in packages.items(): |
1633 | # Create distinct directory locations for |
1634 | # 'from' and 'to' files. |
1635 | absolute_path = os.path.join(tmp_dir, direction) |
1636 | diff --git a/lib/lp/soyuz/model/packageset.py b/lib/lp/soyuz/model/packageset.py |
1637 | index 1aea015..d135b97 100644 |
1638 | --- a/lib/lp/soyuz/model/packageset.py |
1639 | +++ b/lib/lp/soyuz/model/packageset.py |
1640 | @@ -299,7 +299,7 @@ class Packageset(Storm): |
1641 | |
1642 | def addSources(self, names): |
1643 | """See `IPackageset`.""" |
1644 | - if isinstance(names, six.string_types): |
1645 | + if isinstance(names, str): |
1646 | names = [six.ensure_text(names, 'ASCII')] |
1647 | clauses = (SourcePackageName, SourcePackageName.name.is_in(names)) |
1648 | self._api_add_or_remove(clauses, self._addSourcePackageNames) |
1649 | @@ -417,7 +417,7 @@ class PackagesetSet: |
1650 | |
1651 | def _nameToSourcePackageName(self, source_name): |
1652 | """Helper to convert a possible string name to ISourcePackageName.""" |
1653 | - if isinstance(source_name, six.string_types): |
1654 | + if isinstance(source_name, str): |
1655 | source_name = getUtility(ISourcePackageNameSet)[source_name] |
1656 | return source_name |
1657 | |
1658 | diff --git a/lib/lp/soyuz/model/processacceptedbugsjob.py b/lib/lp/soyuz/model/processacceptedbugsjob.py |
1659 | index cfcb7f1..95c69a8 100644 |
1660 | --- a/lib/lp/soyuz/model/processacceptedbugsjob.py |
1661 | +++ b/lib/lp/soyuz/model/processacceptedbugsjob.py |
1662 | @@ -238,7 +238,7 @@ class ProcessAcceptedBugsJob(StormBase, BaseRunnableJob): |
1663 | self.distroseries = distroseries |
1664 | self.sourcepackagerelease = sourcepackagerelease |
1665 | self.metadata = {"bug_ids": list(bug_ids)} |
1666 | - super(ProcessAcceptedBugsJob, self).__init__() |
1667 | + super().__init__() |
1668 | |
1669 | @property |
1670 | def bug_ids(self): |
1671 | diff --git a/lib/lp/soyuz/model/publishing.py b/lib/lp/soyuz/model/publishing.py |
1672 | index 6141c93..421e649 100644 |
1673 | --- a/lib/lp/soyuz/model/publishing.py |
1674 | +++ b/lib/lp/soyuz/model/publishing.py |
1675 | @@ -20,7 +20,6 @@ import os |
1676 | import sys |
1677 | |
1678 | import pytz |
1679 | -import six |
1680 | from storm.expr import ( |
1681 | And, |
1682 | Cast, |
1683 | @@ -485,11 +484,11 @@ class SourcePackagePublishingHistory(SQLBase, ArchivePublisherBase): |
1684 | # Check there is a change to make |
1685 | if new_component is None: |
1686 | new_component = self.component |
1687 | - elif isinstance(new_component, six.string_types): |
1688 | + elif isinstance(new_component, str): |
1689 | new_component = getUtility(IComponentSet)[new_component] |
1690 | if new_section is None: |
1691 | new_section = self.section |
1692 | - elif isinstance(new_section, six.string_types): |
1693 | + elif isinstance(new_section, str): |
1694 | new_section = getUtility(ISectionSet)[new_section] |
1695 | |
1696 | if new_component == self.component and new_section == self.section: |
1697 | @@ -754,7 +753,7 @@ class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase): |
1698 | if self.is_debug and not self.archive.publish_debug_symbols: |
1699 | self.setPublished() |
1700 | else: |
1701 | - super(BinaryPackagePublishingHistory, self).publish(diskpool, log) |
1702 | + super().publish(diskpool, log) |
1703 | |
1704 | def getOtherPublications(self): |
1705 | """See `IBinaryPackagePublishingHistory`.""" |
1706 | @@ -843,15 +842,15 @@ class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase): |
1707 | # Check there is a change to make |
1708 | if new_component is None: |
1709 | new_component = self.component |
1710 | - elif isinstance(new_component, six.string_types): |
1711 | + elif isinstance(new_component, str): |
1712 | new_component = getUtility(IComponentSet)[new_component] |
1713 | if new_section is None: |
1714 | new_section = self.section |
1715 | - elif isinstance(new_section, six.string_types): |
1716 | + elif isinstance(new_section, str): |
1717 | new_section = getUtility(ISectionSet)[new_section] |
1718 | if new_priority is None: |
1719 | new_priority = self.priority |
1720 | - elif isinstance(new_priority, six.string_types): |
1721 | + elif isinstance(new_priority, str): |
1722 | new_priority = name_priority_map[new_priority] |
1723 | if new_phased_update_percentage is None: |
1724 | new_phased_update_percentage = self.phased_update_percentage |
1725 | @@ -1031,7 +1030,7 @@ def expand_binary_requests(distroseries, binaries): |
1726 | arch_map = {arch.architecturetag: arch for arch in archs} |
1727 | |
1728 | expanded = [] |
1729 | - for bpr, overrides in six.iteritems(binaries): |
1730 | + for bpr, overrides in binaries.items(): |
1731 | if bpr.architecturespecific: |
1732 | # Find the DAS in this series corresponding to the original |
1733 | # build arch tag. If it does not exist or is disabled, we should |
1734 | diff --git a/lib/lp/soyuz/model/queue.py b/lib/lp/soyuz/model/queue.py |
1735 | index babe57a..712dd7a 100644 |
1736 | --- a/lib/lp/soyuz/model/queue.py |
1737 | +++ b/lib/lp/soyuz/model/queue.py |
1738 | @@ -16,7 +16,6 @@ from itertools import chain |
1739 | from operator import attrgetter |
1740 | |
1741 | import pytz |
1742 | -import six |
1743 | from storm.expr import Cast |
1744 | from storm.locals import ( |
1745 | And, |
1746 | @@ -206,7 +205,7 @@ class PackageUpload(SQLBase): |
1747 | joinColumn='packageupload') |
1748 | |
1749 | def __init__(self, *args, **kwargs): |
1750 | - super(PackageUpload, self).__init__(*args, **kwargs) |
1751 | + super().__init__(*args, **kwargs) |
1752 | # searchable_{name,version}s are set for the other cases when |
1753 | # add{Source,Build,Custom} are called. |
1754 | if self.package_copy_job: |
1755 | @@ -973,7 +972,7 @@ class PackageUpload(SQLBase): |
1756 | def _nameToComponent(self, component): |
1757 | """Helper to convert a possible string component to IComponent.""" |
1758 | try: |
1759 | - if isinstance(component, six.string_types): |
1760 | + if isinstance(component, str): |
1761 | component = getUtility(IComponentSet)[component] |
1762 | return component |
1763 | except NotFoundError: |
1764 | @@ -982,7 +981,7 @@ class PackageUpload(SQLBase): |
1765 | def _nameToSection(self, section): |
1766 | """Helper to convert a possible string section to ISection.""" |
1767 | try: |
1768 | - if isinstance(section, six.string_types): |
1769 | + if isinstance(section, str): |
1770 | section = getUtility(ISectionSet)[section] |
1771 | return section |
1772 | except NotFoundError: |
1773 | @@ -991,7 +990,7 @@ class PackageUpload(SQLBase): |
1774 | def _nameToPriority(self, priority): |
1775 | """Helper to convert a possible string priority to its enum.""" |
1776 | try: |
1777 | - if isinstance(priority, six.string_types): |
1778 | + if isinstance(priority, str): |
1779 | priority = name_priority_map[priority] |
1780 | return priority |
1781 | except KeyError: |
1782 | diff --git a/lib/lp/soyuz/model/sourcepackagerelease.py b/lib/lp/soyuz/model/sourcepackagerelease.py |
1783 | index 8b07ecc..64086c3 100644 |
1784 | --- a/lib/lp/soyuz/model/sourcepackagerelease.py |
1785 | +++ b/lib/lp/soyuz/model/sourcepackagerelease.py |
1786 | @@ -145,7 +145,7 @@ class SourcePackageRelease(SQLBase): |
1787 | # loaded every time. Set it separately. |
1788 | if 'copyright' in kwargs: |
1789 | copyright = kwargs.pop('copyright') |
1790 | - super(SourcePackageRelease, self).__init__(*args, **kwargs) |
1791 | + super().__init__(*args, **kwargs) |
1792 | # PostgresSQL text columns can't contain null |
1793 | # characters, so remove them as this is only |
1794 | # used for display |
1795 | diff --git a/lib/lp/soyuz/scripts/custom_uploads_copier.py b/lib/lp/soyuz/scripts/custom_uploads_copier.py |
1796 | index 55cd1c7..43a0128 100644 |
1797 | --- a/lib/lp/soyuz/scripts/custom_uploads_copier.py |
1798 | +++ b/lib/lp/soyuz/scripts/custom_uploads_copier.py |
1799 | @@ -13,8 +13,6 @@ __all__ = [ |
1800 | |
1801 | from operator import attrgetter |
1802 | |
1803 | -import six |
1804 | - |
1805 | from lp.archivepublisher.ddtp_tarball import DdtpTarballUpload |
1806 | from lp.archivepublisher.debian_installer import DebianInstallerUpload |
1807 | from lp.archivepublisher.dist_upgrader import DistUpgraderUpload |
1808 | @@ -164,7 +162,7 @@ class CustomUploadsCopier: |
1809 | self.target_series, source_pocket=self.target_pocket) |
1810 | source_uploads = self.getLatestUploads( |
1811 | source_series, source_pocket=source_pocket) |
1812 | - for upload in six.itervalues(source_uploads): |
1813 | + for upload in source_uploads.values(): |
1814 | if (not self.isObsolete(upload, target_uploads) and |
1815 | self.isForValidDAS(upload)): |
1816 | self.copyUpload(upload) |
1817 | diff --git a/lib/lp/soyuz/scripts/ftpmasterbase.py b/lib/lp/soyuz/scripts/ftpmasterbase.py |
1818 | index 0b3aa2e..7a1fe88 100644 |
1819 | --- a/lib/lp/soyuz/scripts/ftpmasterbase.py |
1820 | +++ b/lib/lp/soyuz/scripts/ftpmasterbase.py |
1821 | @@ -11,8 +11,6 @@ __all__ = [ |
1822 | 'SoyuzScript', |
1823 | ] |
1824 | |
1825 | -from six.moves import input |
1826 | - |
1827 | from lp.services.scripts.base import ( |
1828 | LaunchpadScript, |
1829 | LaunchpadScriptFailure, |
1830 | diff --git a/lib/lp/soyuz/scripts/gina/handlers.py b/lib/lp/soyuz/scripts/gina/handlers.py |
1831 | index b527ab7..483af39 100644 |
1832 | --- a/lib/lp/soyuz/scripts/gina/handlers.py |
1833 | +++ b/lib/lp/soyuz/scripts/gina/handlers.py |
1834 | @@ -22,7 +22,6 @@ import io |
1835 | import os |
1836 | import re |
1837 | |
1838 | -import six |
1839 | from storm.exceptions import NotOneError |
1840 | from storm.expr import ( |
1841 | Cast, |
1842 | @@ -504,8 +503,7 @@ class SourcePackageHandler: |
1843 | sp_version, sp_component)) |
1844 | dsc_contents = parse_tagfile(dsc_path) |
1845 | dsc_contents = { |
1846 | - name.lower(): value for |
1847 | - (name, value) in six.iteritems(dsc_contents)} |
1848 | + name.lower(): value for (name, value) in dsc_contents.items()} |
1849 | |
1850 | # Since the dsc doesn't know, we add in the directory, package |
1851 | # component and section |
1852 | diff --git a/lib/lp/soyuz/scripts/gina/runner.py b/lib/lp/soyuz/scripts/gina/runner.py |
1853 | index df60215..fbdecf5 100644 |
1854 | --- a/lib/lp/soyuz/scripts/gina/runner.py |
1855 | +++ b/lib/lp/soyuz/scripts/gina/runner.py |
1856 | @@ -165,7 +165,7 @@ def import_sourcepackages(distro, packages_map, package_root, |
1857 | |
1858 | def do_one_sourcepackage(distro, source, package_root, importer_handler): |
1859 | source_data = SourcePackageData(**source) |
1860 | - skip_key = u'%s/%s/%s' % (distro, source_data.package, source_data.version) |
1861 | + skip_key = '%s/%s/%s' % (distro, source_data.package, source_data.version) |
1862 | skip_list = getFeatureFlag('soyuz.gina.skip_source_versions') |
1863 | if skip_list is not None and skip_key in skip_list.split(): |
1864 | log.info( |
1865 | diff --git a/lib/lp/soyuz/scripts/packagecopier.py b/lib/lp/soyuz/scripts/packagecopier.py |
1866 | index c1fb6cb..d5388d3 100644 |
1867 | --- a/lib/lp/soyuz/scripts/packagecopier.py |
1868 | +++ b/lib/lp/soyuz/scripts/packagecopier.py |
1869 | @@ -259,8 +259,7 @@ class CopyChecker: |
1870 | def getCheckedCopies(self): |
1871 | """Return a list of copies allowed to be performed.""" |
1872 | for copies in self._inventory.values(): |
1873 | - for copy in copies: |
1874 | - yield copy |
1875 | + yield from copies |
1876 | |
1877 | def getConflicts(self, candidate): |
1878 | """Conflicting `CheckedCopy` objects in the inventory. |
1879 | diff --git a/lib/lp/soyuz/scripts/populate_archive.py b/lib/lp/soyuz/scripts/populate_archive.py |
1880 | index 0eb4f68..1b9b12b 100644 |
1881 | --- a/lib/lp/soyuz/scripts/populate_archive.py |
1882 | +++ b/lib/lp/soyuz/scripts/populate_archive.py |
1883 | @@ -36,7 +36,7 @@ def specified(option): |
1884 | """ |
1885 | if option is None: |
1886 | return False |
1887 | - if isinstance(option, six.string_types) and option.strip() == '': |
1888 | + if isinstance(option, str) and option.strip() == '': |
1889 | return False |
1890 | return True |
1891 | |
1892 | diff --git a/lib/lp/soyuz/scripts/ppareport.py b/lib/lp/soyuz/scripts/ppareport.py |
1893 | index 94914fe..c9e106c 100644 |
1894 | --- a/lib/lp/soyuz/scripts/ppareport.py |
1895 | +++ b/lib/lp/soyuz/scripts/ppareport.py |
1896 | @@ -186,7 +186,7 @@ class PPAReportScript(LaunchpadScript): |
1897 | sorted_people_to_email = sorted( |
1898 | people_to_email, key=operator.attrgetter('name')) |
1899 | for user in sorted_people_to_email: |
1900 | - line = u"%s | %s | %s\n" % ( |
1901 | + line = "%s | %s | %s\n" % ( |
1902 | user.name, user.displayname, user.preferredemail.email) |
1903 | self.output.write(six.ensure_str(line)) |
1904 | self.output.write('\n') |
1905 | diff --git a/lib/lp/soyuz/scripts/retrydepwait.py b/lib/lp/soyuz/scripts/retrydepwait.py |
1906 | index a6a41af..9f86c24 100644 |
1907 | --- a/lib/lp/soyuz/scripts/retrydepwait.py |
1908 | +++ b/lib/lp/soyuz/scripts/retrydepwait.py |
1909 | @@ -33,7 +33,7 @@ class RetryDepwaitTunableLoop(TunableLoop): |
1910 | maximum_chunk_size = 5000 |
1911 | |
1912 | def __init__(self, log, dry_run, abort_time=None): |
1913 | - super(RetryDepwaitTunableLoop, self).__init__(log, abort_time) |
1914 | + super().__init__(log, abort_time) |
1915 | self.dry_run = dry_run |
1916 | self.start_at = 1 |
1917 | self.store = IStore(BinaryPackageBuild) |
1918 | diff --git a/lib/lp/soyuz/scripts/tests/test_copypackage.py b/lib/lp/soyuz/scripts/tests/test_copypackage.py |
1919 | index 62ced33..223f697 100644 |
1920 | --- a/lib/lp/soyuz/scripts/tests/test_copypackage.py |
1921 | +++ b/lib/lp/soyuz/scripts/tests/test_copypackage.py |
1922 | @@ -440,7 +440,7 @@ class CopyCheckerQueries(TestCaseWithFactory, |
1923 | layer = LaunchpadZopelessLayer |
1924 | |
1925 | def setUp(self): |
1926 | - super(CopyCheckerQueries, self).setUp() |
1927 | + super().setUp() |
1928 | self.test_publisher = SoyuzTestPublisher() |
1929 | self.test_publisher.prepareBreezyAutotest() |
1930 | self.source = self.test_publisher.getPubSource() |
1931 | @@ -458,8 +458,8 @@ class CopyCheckerQueries(TestCaseWithFactory, |
1932 | sources = [] |
1933 | for i in range(nb_of_sources): |
1934 | source = self.test_publisher.getPubSource( |
1935 | - version=u'%d' % self.factory.getUniqueInteger(), |
1936 | - sourcename=u'name-%d' % self.factory.getUniqueInteger()) |
1937 | + version='%d' % self.factory.getUniqueInteger(), |
1938 | + sourcename='name-%d' % self.factory.getUniqueInteger()) |
1939 | sources.append(source) |
1940 | return sources |
1941 | |
1942 | @@ -486,7 +486,7 @@ class CopyCheckerQueries(TestCaseWithFactory, |
1943 | recorder0 = self._recordCopyCheck(0, self.person, True) |
1944 | self.addDetail( |
1945 | "statement-count-0-sources", |
1946 | - text_content(u"%d" % recorder0.count)) |
1947 | + text_content("%d" % recorder0.count)) |
1948 | self.assertThat(recorder0, HasQueryCount(Equals(0))) |
1949 | |
1950 | # Compare the number of queries issued by calling checkCopy with |
1951 | @@ -495,12 +495,12 @@ class CopyCheckerQueries(TestCaseWithFactory, |
1952 | recorder1 = self._recordCopyCheck(nb_of_sources, self.person, True) |
1953 | self.addDetail( |
1954 | "statement-count-%d-sources" % nb_of_sources, |
1955 | - text_content(u"%d" % recorder1.count)) |
1956 | + text_content("%d" % recorder1.count)) |
1957 | recorder2 = self._recordCopyCheck( |
1958 | nb_of_sources + 1, self.person, True) |
1959 | self.addDetail( |
1960 | "statement-count-%d-sources" % (nb_of_sources + 1), |
1961 | - text_content(u"%d" % recorder2.count)) |
1962 | + text_content("%d" % recorder2.count)) |
1963 | |
1964 | statement_count_per_source = 13 |
1965 | self.assertThat( |
1966 | @@ -518,7 +518,7 @@ class CopyCheckerQueries(TestCaseWithFactory, |
1967 | (recorder2.count - recorder1.count) / float(nb_of_sources)) |
1968 | self.addDetail( |
1969 | "added-statement-count-perm-check", |
1970 | - text_content(u"%.3f" % added_statement_count_per_source)) |
1971 | + text_content("%.3f" % added_statement_count_per_source)) |
1972 | |
1973 | perm_check_statement_count = 3 |
1974 | self.assertThat( |
1975 | @@ -531,7 +531,7 @@ class CopyCheckerSameArchiveHarness(TestCaseWithFactory, |
1976 | layer = LaunchpadZopelessLayer |
1977 | |
1978 | def setUp(self): |
1979 | - super(CopyCheckerSameArchiveHarness, self).setUp() |
1980 | + super().setUp() |
1981 | self.test_publisher = SoyuzTestPublisher() |
1982 | self.test_publisher.prepareBreezyAutotest() |
1983 | self.source = self.test_publisher.getPubSource() |
1984 | @@ -609,7 +609,7 @@ class CopyCheckerDifferentArchiveHarness(TestCaseWithFactory, |
1985 | layer = LaunchpadZopelessLayer |
1986 | |
1987 | def setUp(self): |
1988 | - super(CopyCheckerDifferentArchiveHarness, self).setUp() |
1989 | + super().setUp() |
1990 | self.test_publisher = SoyuzTestPublisher() |
1991 | self.test_publisher.prepareBreezyAutotest() |
1992 | self.source = self.test_publisher.getPubSource() |
1993 | @@ -825,7 +825,7 @@ class CopyCheckerTestCase(TestCaseWithFactory): |
1994 | layer = LaunchpadZopelessLayer |
1995 | |
1996 | def setUp(self): |
1997 | - super(CopyCheckerTestCase, self).setUp() |
1998 | + super().setUp() |
1999 | self.test_publisher = SoyuzTestPublisher() |
2000 | self.test_publisher.prepareBreezyAutotest() |
2001 | |
2002 | @@ -1051,7 +1051,7 @@ class BaseDoCopyTests: |
2003 | layer = LaunchpadZopelessLayer |
2004 | |
2005 | def setUp(self): |
2006 | - super(BaseDoCopyTests, self).setUp() |
2007 | + super().setUp() |
2008 | for arch in ('i386', 'hppa'): |
2009 | self.factory.makeProcessor(name='my_%s' % arch) |
2010 | |
2011 | @@ -1130,14 +1130,14 @@ class BaseDoCopyTests: |
2012 | class TestDoDirectCopy(BaseDoCopyTests, TestCaseWithFactory): |
2013 | |
2014 | def setUp(self): |
2015 | - super(TestDoDirectCopy, self).setUp() |
2016 | + super().setUp() |
2017 | self.test_publisher = SoyuzTestPublisher() |
2018 | self.test_publisher.prepareBreezyAutotest() |
2019 | |
2020 | def assertCopied(self, copies, series, arch_tags): |
2021 | self.assertEqual( |
2022 | - [u'foo 666 in %s' % series.name] + |
2023 | - [u'foo-bin 666 in %s %s' % (series.name, arch_tag) |
2024 | + ['foo 666 in %s' % series.name] + |
2025 | + ['foo-bin 666 in %s %s' % (series.name, arch_tag) |
2026 | for arch_tag in arch_tags], |
2027 | [copy.displayname for copy in copies]) |
2028 | |
2029 | @@ -1782,7 +1782,7 @@ class TestCopyBuildRecords(TestCaseWithFactory): |
2030 | layer = LaunchpadZopelessLayer |
2031 | |
2032 | def setUp(self): |
2033 | - super(TestCopyBuildRecords, self).setUp() |
2034 | + super().setUp() |
2035 | self.test_publisher = SoyuzTestPublisher() |
2036 | self.test_publisher.prepareBreezyAutotest() |
2037 | self.primary = self.test_publisher.ubuntutest.main_archive |
2038 | @@ -2047,7 +2047,7 @@ class TestCopyClosesBugs(TestCaseWithFactory): |
2039 | layer = LaunchpadZopelessLayer |
2040 | |
2041 | def setUp(self): |
2042 | - super(TestCopyClosesBugs, self).setUp() |
2043 | + super().setUp() |
2044 | self.test_publisher = SoyuzTestPublisher() |
2045 | self.test_publisher.prepareBreezyAutotest() |
2046 | self.ubuntutest = self.test_publisher.ubuntutest |
2047 | diff --git a/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py b/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py |
2048 | index fefef02..a5d381d 100644 |
2049 | --- a/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py |
2050 | +++ b/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py |
2051 | @@ -28,7 +28,7 @@ class ArchiveExpiryTestBase(TestCaseWithFactory): |
2052 | |
2053 | def setUp(self): |
2054 | """Set up some test publications.""" |
2055 | - super(ArchiveExpiryTestBase, self).setUp() |
2056 | + super().setUp() |
2057 | # Configure the test publisher. |
2058 | switch_dbuser("launchpad") |
2059 | self.stp = SoyuzTestPublisher() |
2060 | @@ -100,7 +100,7 @@ class ArchiveExpiryTestBase(TestCaseWithFactory): |
2061 | "lfa.expires should be None, but it's not.") |
2062 | |
2063 | |
2064 | -class ArchiveExpiryCommonTests(object): |
2065 | +class ArchiveExpiryCommonTests: |
2066 | """Common source/binary expiration test cases. |
2067 | |
2068 | These will be shared irrespective of archive type (ppa/partner). |
2069 | @@ -233,7 +233,7 @@ class TestPPAExpiry(ArchiveExpiryTestBase, ArchiveExpiryCommonTests): |
2070 | |
2071 | def setUp(self): |
2072 | """Set up some test publications.""" |
2073 | - super(TestPPAExpiry, self).setUp() |
2074 | + super().setUp() |
2075 | # Prepare two PPAs for the tests to use. |
2076 | self.archive = self.factory.makeArchive( |
2077 | distribution=getUtility(IDistributionSet)['ubuntutest']) |
2078 | @@ -287,7 +287,7 @@ class TestPartnerExpiry(ArchiveExpiryTestBase, ArchiveExpiryCommonTests): |
2079 | |
2080 | def setUp(self): |
2081 | """Set up the partner archives under test.""" |
2082 | - super(TestPartnerExpiry, self).setUp() |
2083 | + super().setUp() |
2084 | # Prepare two partner archives for the tests to use. |
2085 | self.archive = getUtility(IDistributionSet)[ |
2086 | 'ubuntutest'].getArchiveByComponent('partner') |
2087 | diff --git a/lib/lp/soyuz/scripts/tests/test_gina.py b/lib/lp/soyuz/scripts/tests/test_gina.py |
2088 | index 69720b1..f8174f3 100644 |
2089 | --- a/lib/lp/soyuz/scripts/tests/test_gina.py |
2090 | +++ b/lib/lp/soyuz/scripts/tests/test_gina.py |
2091 | @@ -248,7 +248,7 @@ class TestSourcePackageData(TestCaseWithFactory): |
2092 | # called in such a way as to cope with non-UTF-8 file names on |
2093 | # Python 2. See |
2094 | # https://bugs.launchpad.net/launchpad/+bug/1917449. |
2095 | - orig_tar.add_file(u"Ćslenska.alias", b"Non-UTF-8 file name") |
2096 | + orig_tar.add_file("Ćslenska.alias", b"Non-UTF-8 file name") |
2097 | orig_tar.close() |
2098 | buffer.seek(0) |
2099 | orig_tar_contents = buffer.read() |
2100 | @@ -309,7 +309,7 @@ class TestSourcePackageData(TestCaseWithFactory): |
2101 | # called in such a way as to cope with non-UTF-8 file names on |
2102 | # Python 2. See |
2103 | # https://bugs.launchpad.net/launchpad/+bug/1917449. |
2104 | - orig_tar.add_file(u"Ćslenska.alias", b"Non-UTF-8 file name") |
2105 | + orig_tar.add_file("Ćslenska.alias", b"Non-UTF-8 file name") |
2106 | orig_tar.close() |
2107 | buffer.seek(0) |
2108 | orig_tar_contents = buffer.read() |
2109 | diff --git a/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py b/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py |
2110 | index b3edb46..f3fa2cc 100644 |
2111 | --- a/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py |
2112 | +++ b/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py |
2113 | @@ -194,10 +194,10 @@ class InitializationHelperTestCase(TestCaseWithFactory): |
2114 | # Setup the environment for testing the packaging links |
2115 | self.parent, self.parent_das = self.setupParent() |
2116 | test1 = getUtility(IPackagesetSet).new( |
2117 | - u'test1', u'test 1 packageset', self.parent.owner, |
2118 | + 'test1', 'test 1 packageset', self.parent.owner, |
2119 | distroseries=self.parent) |
2120 | test2 = getUtility(IPackagesetSet).new( |
2121 | - u'test2', u'test 2 packageset', self.parent.owner, |
2122 | + 'test2', 'test 2 packageset', self.parent.owner, |
2123 | distroseries=self.parent) |
2124 | packages_test1 = ['udev', 'chromium', 'libc6'] |
2125 | packages_test2 = ['postgresql', 'vim'] |
2126 | @@ -351,9 +351,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2127 | # packagesets selected for the copy will make the queue check fail. |
2128 | parent, parent_das = self.setupParent() |
2129 | p1, packageset1, unsed = self.createPackageInPackageset( |
2130 | - parent, u'p1', u'packageset1', True) |
2131 | + parent, 'p1', 'packageset1', True) |
2132 | p2, packageset2, unsed = self.createPackageInPackageset( |
2133 | - parent, u'p2', u'packageset2', False) |
2134 | + parent, 'p2', 'packageset2', False) |
2135 | |
2136 | child = self.factory.makeDistroSeries( |
2137 | distribution=parent.distribution, previous_series=parent) |
2138 | @@ -371,9 +371,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2139 | # packagesets selected for the copy won't make the queue check fail. |
2140 | parent, parent_das = self.setupParent() |
2141 | p1, packageset1, unused = self.createPackageInPackageset( |
2142 | - parent, u'p1', u'packageset1', True) |
2143 | + parent, 'p1', 'packageset1', True) |
2144 | p2, packageset2, unused = self.createPackageInPackageset( |
2145 | - parent, u'p2', u'packageset2', False) |
2146 | + parent, 'p2', 'packageset2', False) |
2147 | |
2148 | child = self.factory.makeDistroSeries( |
2149 | distribution=parent.distribution, previous_series=parent) |
2150 | @@ -596,9 +596,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2151 | # initialize. |
2152 | parent, parent_das = self.setupParent() |
2153 | p1, packageset1, spr1 = self.createPackageInPackageset( |
2154 | - parent, u'p1', u'packageset1', False) |
2155 | + parent, 'p1', 'packageset1', False) |
2156 | p2, packageset2, spr2 = self.createPackageInPackageset( |
2157 | - parent, u'p2', u'packageset2', False) |
2158 | + parent, 'p2', 'packageset2', False) |
2159 | |
2160 | # Create a binary package upload for the package 'p2' inside |
2161 | # packageset 'packageset2'. |
2162 | @@ -622,7 +622,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2163 | # initialize. |
2164 | parent, parent_das = self.setupParent() |
2165 | p1, packageset1, spr1 = self.createPackageInPackageset( |
2166 | - parent, u'p1', u'packageset1', False) |
2167 | + parent, 'p1', 'packageset1', False) |
2168 | |
2169 | # Create a binary package upload for the package 'p2' inside |
2170 | # packageset 'packageset2'. |
2171 | @@ -648,31 +648,31 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2172 | child_pocket=PackagePublishingPocket.RELEASE): |
2173 | # Check that 'udev' has been copied correctly. |
2174 | parent_udev_pubs = parent.main_archive.getPublishedSources( |
2175 | - u'udev', distroseries=parent) |
2176 | + 'udev', distroseries=parent) |
2177 | child_udev_pubs = child.main_archive.getPublishedSources( |
2178 | - u'udev', distroseries=child) |
2179 | + 'udev', distroseries=child) |
2180 | self.assertEqual( |
2181 | parent_udev_pubs.count(), child_udev_pubs.count()) |
2182 | self.assertEqual( |
2183 | {child_pocket}, {pub.pocket for pub in child_udev_pubs}) |
2184 | parent_arch_udev_pubs = parent.main_archive.getAllPublishedBinaries( |
2185 | - distroarchseries=parent[parent_das.architecturetag], name=u'udev') |
2186 | + distroarchseries=parent[parent_das.architecturetag], name='udev') |
2187 | child_arch_udev_pubs = child.main_archive.getAllPublishedBinaries( |
2188 | - distroarchseries=child[parent_das.architecturetag], name=u'udev') |
2189 | + distroarchseries=child[parent_das.architecturetag], name='udev') |
2190 | self.assertEqual( |
2191 | parent_arch_udev_pubs.count(), child_arch_udev_pubs.count()) |
2192 | self.assertEqual( |
2193 | {child_pocket}, {pub.pocket for pub in child_arch_udev_pubs}) |
2194 | # And the binary package, and linked source package look fine too. |
2195 | udev_bin = child_arch_udev_pubs[0].binarypackagerelease |
2196 | - self.assertEqual(udev_bin.title, u'udev-0.1-1') |
2197 | + self.assertEqual(udev_bin.title, 'udev-0.1-1') |
2198 | self.assertEqual( |
2199 | udev_bin.build.title, |
2200 | - u'%s build of udev 0.1-1 in %s %s RELEASE' % ( |
2201 | + '%s build of udev 0.1-1 in %s %s RELEASE' % ( |
2202 | parent_das.architecturetag, parent.parent.name, |
2203 | parent.name)) |
2204 | udev_src = udev_bin.build.source_package_release |
2205 | - self.assertEqual(udev_src.title, u'udev - 0.1-1') |
2206 | + self.assertEqual(udev_src.title, 'udev - 0.1-1') |
2207 | # The build of udev 0.1-1 has been copied across. |
2208 | bpbs = getUtility(IBinaryPackageBuildSet) |
2209 | child_udev = bpbs.findBuiltOrPublishedBySourceAndArchive( |
2210 | @@ -721,22 +721,22 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2211 | self.parent, self.parent_das = self.setupParent() |
2212 | uploader = self.factory.makePerson() |
2213 | test1 = getUtility(IPackagesetSet).new( |
2214 | - u'test1', u'test 1 packageset', self.parent.owner, |
2215 | + 'test1', 'test 1 packageset', self.parent.owner, |
2216 | distroseries=self.parent) |
2217 | test2 = getUtility(IPackagesetSet).new( |
2218 | - u'test2', u'test 2 packageset', self.parent.owner, |
2219 | + 'test2', 'test 2 packageset', self.parent.owner, |
2220 | distroseries=self.parent) |
2221 | test3 = getUtility(IPackagesetSet).new( |
2222 | - u'test3', u'test 3 packageset', self.parent.owner, |
2223 | + 'test3', 'test 3 packageset', self.parent.owner, |
2224 | distroseries=self.parent, related_set=test2) |
2225 | test1.addSources('udev') |
2226 | getUtility(IArchivePermissionSet).newPackagesetUploader( |
2227 | self.parent.main_archive, uploader, test1) |
2228 | child = self._fullInitialize([self.parent]) |
2229 | # We can fetch the copied sets from the child. |
2230 | - child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1') |
2231 | - child_test2 = getUtility(IPackagesetSet).getByName(child, u'test2') |
2232 | - child_test3 = getUtility(IPackagesetSet).getByName(child, u'test3') |
2233 | + child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1') |
2234 | + child_test2 = getUtility(IPackagesetSet).getByName(child, 'test2') |
2235 | + child_test3 = getUtility(IPackagesetSet).getByName(child, 'test3') |
2236 | # And we can see they are exact copies, with the related_set for the |
2237 | # copies pointing to the packageset in the parent. |
2238 | self.assertEqual(test1.description, child_test1.description) |
2239 | @@ -765,7 +765,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2240 | packages={'firefox': '3.1'}) |
2241 | uploader = self.factory.makePerson() |
2242 | test1 = getUtility(IPackagesetSet).new( |
2243 | - u'test1', u'test 1 packageset', self.parent1.owner, |
2244 | + 'test1', 'test 1 packageset', self.parent1.owner, |
2245 | distroseries=self.parent1) |
2246 | test1.addSources('udev') |
2247 | test1.addSources('firefox') |
2248 | @@ -782,7 +782,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2249 | s.sourcepackagerelease.version) |
2250 | for s in published_sources) |
2251 | self.assertContentEqual( |
2252 | - [(u'udev', u'0.1-1'), (u'firefox', u'2.1')], |
2253 | + [('udev', '0.1-1'), ('firefox', '2.1')], |
2254 | pub_sources) |
2255 | |
2256 | def test_copying_packagesets_no_duplication(self): |
2257 | @@ -792,7 +792,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2258 | parent = self._fullInitialize([previous_parent]) |
2259 | self.factory.makeSourcePackagePublishingHistory(distroseries=parent) |
2260 | p1, parent_packageset, _ = self.createPackageInPackageset( |
2261 | - parent, u"p1", u"packageset") |
2262 | + parent, "p1", "packageset") |
2263 | uploader1 = self.factory.makePerson() |
2264 | getUtility(IArchivePermissionSet).newPackagesetUploader( |
2265 | parent.main_archive, uploader1, parent_packageset) |
2266 | @@ -802,8 +802,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2267 | # Make sure the child's packageset has disjoint packages and |
2268 | # permissions. |
2269 | p2, child_packageset, _ = self.createPackageInPackageset( |
2270 | - child, u"p2", u"packageset") |
2271 | - child_packageset.removeSources([u"p1"]) |
2272 | + child, "p2", "packageset") |
2273 | + child_packageset.removeSources(["p1"]) |
2274 | uploader2 = self.factory.makePerson() |
2275 | getUtility(IArchivePermissionSet).newPackagesetUploader( |
2276 | child.main_archive, uploader2, child_packageset) |
2277 | @@ -834,7 +834,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2278 | uploader = self.factory.makePerson() |
2279 | releaser = self.factory.makePerson() |
2280 | test1 = self.factory.makePackageset( |
2281 | - u'test1', u'test 1 packageset', parent.owner, |
2282 | + 'test1', 'test 1 packageset', parent.owner, |
2283 | distroseries=parent) |
2284 | #test1 = getUtility(IPackagesetSet).new( |
2285 | # u'test1', u'test 1 packageset', self.parent.owner, |
2286 | @@ -876,7 +876,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2287 | uploader = self.factory.makePerson() |
2288 | releaser = self.factory.makePerson() |
2289 | test1 = getUtility(IPackagesetSet).new( |
2290 | - u'test1', u'test 1 packageset', self.parent.owner, |
2291 | + 'test1', 'test 1 packageset', self.parent.owner, |
2292 | distroseries=self.parent) |
2293 | test1.addSources('udev') |
2294 | archive_permset = getUtility(IArchivePermissionSet) |
2295 | @@ -1030,10 +1030,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2296 | self.parent, self.parent_das = self.setupParent(packages={}) |
2297 | ps_owner = self.factory.makePerson() |
2298 | getUtility(IPackagesetSet).new( |
2299 | - u'ps', u'packageset', ps_owner, distroseries=self.parent) |
2300 | + 'ps', 'packageset', ps_owner, distroseries=self.parent) |
2301 | child = self._fullInitialize( |
2302 | [self.parent], distribution=self.parent.distribution) |
2303 | - child_ps = getUtility(IPackagesetSet).getByName(child, u'ps') |
2304 | + child_ps = getUtility(IPackagesetSet).getByName(child, 'ps') |
2305 | self.assertEqual(ps_owner, child_ps.owner) |
2306 | |
2307 | def test_packageset_owner_not_preserved_cross_distro(self): |
2308 | @@ -1041,10 +1041,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2309 | # packagesets are owned by the new distro owner. |
2310 | self.parent, self.parent_das = self.setupParent() |
2311 | getUtility(IPackagesetSet).new( |
2312 | - u'ps', u'packageset', self.factory.makePerson(), |
2313 | + 'ps', 'packageset', self.factory.makePerson(), |
2314 | distroseries=self.parent) |
2315 | child = self._fullInitialize([self.parent]) |
2316 | - child_ps = getUtility(IPackagesetSet).getByName(child, u'ps') |
2317 | + child_ps = getUtility(IPackagesetSet).getByName(child, 'ps') |
2318 | self.assertEqual(child.owner, child_ps.owner) |
2319 | |
2320 | def test_copy_limit_packagesets(self): |
2321 | @@ -1052,23 +1052,23 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2322 | # want to copy. |
2323 | self.parent, self.parent_das = self.setupParent() |
2324 | test1 = getUtility(IPackagesetSet).new( |
2325 | - u'test1', u'test 1 packageset', self.parent.owner, |
2326 | + 'test1', 'test 1 packageset', self.parent.owner, |
2327 | distroseries=self.parent) |
2328 | getUtility(IPackagesetSet).new( |
2329 | - u'test2', u'test 2 packageset', self.parent.owner, |
2330 | + 'test2', 'test 2 packageset', self.parent.owner, |
2331 | distroseries=self.parent) |
2332 | packages = ('udev', 'chromium', 'libc6') |
2333 | for pkg in packages: |
2334 | test1.addSources(pkg) |
2335 | packageset1 = getUtility(IPackagesetSet).getByName( |
2336 | - self.parent, u'test1') |
2337 | + self.parent, 'test1') |
2338 | child = self._fullInitialize( |
2339 | [self.parent], packagesets=(str(packageset1.id),)) |
2340 | - child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1') |
2341 | + child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1') |
2342 | self.assertEqual(test1.description, child_test1.description) |
2343 | self.assertRaises( |
2344 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, |
2345 | - child, u'test2') |
2346 | + child, 'test2') |
2347 | parent_srcs = test1.getSourcesIncluded(direct_inclusion=True) |
2348 | child_srcs = child_test1.getSourcesIncluded( |
2349 | direct_inclusion=True) |
2350 | @@ -1081,10 +1081,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2351 | # If a parent series has packagesets, we don't want to copy any of them |
2352 | self.parent, self.parent_das = self.setupParent() |
2353 | test1 = getUtility(IPackagesetSet).new( |
2354 | - u'test1', u'test 1 packageset', self.parent.owner, |
2355 | + 'test1', 'test 1 packageset', self.parent.owner, |
2356 | distroseries=self.parent) |
2357 | getUtility(IPackagesetSet).new( |
2358 | - u'test2', u'test 2 packageset', self.parent.owner, |
2359 | + 'test2', 'test 2 packageset', self.parent.owner, |
2360 | distroseries=self.parent) |
2361 | packages = ('udev', 'chromium', 'libc6') |
2362 | for pkg in packages: |
2363 | @@ -1093,10 +1093,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2364 | [self.parent], packagesets=[]) |
2365 | self.assertRaises( |
2366 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, |
2367 | - child, u'test1') |
2368 | + child, 'test1') |
2369 | self.assertRaises( |
2370 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, |
2371 | - child, u'test2') |
2372 | + child, 'test2') |
2373 | self.assertEqual(child.sourcecount, 0) |
2374 | self.assertEqual(child.binarycount, 0) |
2375 | |
2376 | @@ -1104,10 +1104,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2377 | # If a parent series has packagesets, we want to copy all of them |
2378 | self.parent, self.parent_das = self.setupParent() |
2379 | test1 = getUtility(IPackagesetSet).new( |
2380 | - u'test1', u'test 1 packageset', self.parent.owner, |
2381 | + 'test1', 'test 1 packageset', self.parent.owner, |
2382 | distroseries=self.parent) |
2383 | test2 = getUtility(IPackagesetSet).new( |
2384 | - u'test2', u'test 2 packageset', self.parent.owner, |
2385 | + 'test2', 'test 2 packageset', self.parent.owner, |
2386 | distroseries=self.parent) |
2387 | packages_test1 = ('udev', 'chromium', 'libc6') |
2388 | packages_test2 = ('postgresql', 'vim') |
2389 | @@ -1117,8 +1117,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2390 | test2.addSources(pkg) |
2391 | child = self._fullInitialize( |
2392 | [self.parent], packagesets=None) |
2393 | - child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1') |
2394 | - child_test2 = getUtility(IPackagesetSet).getByName(child, u'test2') |
2395 | + child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1') |
2396 | + child_test2 = getUtility(IPackagesetSet).getByName(child, 'test2') |
2397 | self.assertEqual(test1.description, child_test1.description) |
2398 | self.assertEqual(test2.description, child_test2.description) |
2399 | parent_srcs_test1 = test1.getSourcesIncluded(direct_inclusion=True) |
2400 | @@ -1139,7 +1139,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2401 | # the packaging links for the copied packages are copied. |
2402 | packages_test1, packages_test2 = self.setupPackagingTesting() |
2403 | packageset1 = getUtility(IPackagesetSet).getByName( |
2404 | - self.parent, u'test1') |
2405 | + self.parent, 'test1') |
2406 | child = self._fullInitialize( |
2407 | [self.parent], packagesets=(str(packageset1.id),)) |
2408 | packagings = child.getMostRecentlyLinkedPackagings() |
2409 | @@ -1197,10 +1197,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2410 | # for the copied source will be created. |
2411 | self.parent, self.parent_das = self.setupParent() |
2412 | test1 = getUtility(IPackagesetSet).new( |
2413 | - u'test1', u'test 1 packageset', self.parent.owner, |
2414 | + 'test1', 'test 1 packageset', self.parent.owner, |
2415 | distroseries=self.parent) |
2416 | getUtility(IPackagesetSet).new( |
2417 | - u'test2', u'test 2 packageset', self.parent.owner, |
2418 | + 'test2', 'test 2 packageset', self.parent.owner, |
2419 | distroseries=self.parent) |
2420 | packages = ('udev', 'chromium') |
2421 | for pkg in packages: |
2422 | @@ -1331,10 +1331,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2423 | uploader1 = self.factory.makePerson() |
2424 | uploader2 = self.factory.makePerson() |
2425 | test1_parent1 = getUtility(IPackagesetSet).new( |
2426 | - u'test1', u'test 1 packageset', self.parent1.owner, |
2427 | + 'test1', 'test 1 packageset', self.parent1.owner, |
2428 | distroseries=self.parent1) |
2429 | test1_parent2 = getUtility(IPackagesetSet).new( |
2430 | - u'test1', u'test 1 packageset', self.parent2.owner, |
2431 | + 'test1', 'test 1 packageset', self.parent2.owner, |
2432 | distroseries=self.parent2) |
2433 | test1_parent1.addSources('chromium') |
2434 | test1_parent1.addSources('udev') |
2435 | @@ -1347,7 +1347,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2436 | child = self._fullInitialize([self.parent1, self.parent2]) |
2437 | |
2438 | # In the child, the identical packagesets are merged into one. |
2439 | - child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1') |
2440 | + child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1') |
2441 | child_srcs = child_test1.getSourcesIncluded( |
2442 | direct_inclusion=True) |
2443 | parent1_srcs = test1_parent1.getSourcesIncluded(direct_inclusion=True) |
2444 | @@ -1449,8 +1449,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2445 | # If the series to be initialized is in a distribution with |
2446 | # initialized series, the series is *derived* from |
2447 | # the previous_series' parents. |
2448 | - previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2449 | - previous_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2450 | + previous_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2451 | + previous_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2452 | child = self.setUpSeriesWithPreviousSeries( |
2453 | previous_parents=[previous_parent1, previous_parent2]) |
2454 | parent, unused = self.setupParent() |
2455 | @@ -1471,14 +1471,14 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2456 | s.sourcepackagerelease.version) |
2457 | for s in published_sources) |
2458 | self.assertEqual( |
2459 | - [(u'p1', u'1.2'), (u'p2', u'1.5')], |
2460 | + [('p1', '1.2'), ('p2', '1.5')], |
2461 | pub_sources) |
2462 | |
2463 | def test_derive_from_previous_parents_empty_parents(self): |
2464 | # If an empty list is passed to InitializeDistroSeries, the |
2465 | # parents of the previous series are used as parents. |
2466 | - previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2467 | - previous_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2468 | + previous_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2469 | + previous_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2470 | child = self.setUpSeriesWithPreviousSeries( |
2471 | previous_parents=[previous_parent1, previous_parent2]) |
2472 | # Initialize from an empty list of parents. |
2473 | @@ -1491,7 +1491,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2474 | def test_derive_empty_parents_distribution_not_initialized(self): |
2475 | # Initializing a series with an empty parent list if the series' |
2476 | # distribution has no initialized series triggers an error. |
2477 | - previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2478 | + previous_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2479 | child = self.setUpSeriesWithPreviousSeries( |
2480 | previous_parents=[previous_parent1], |
2481 | publish_in_distribution=False, |
2482 | @@ -1601,7 +1601,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2483 | # The new publishings, copied over from the parents, have their |
2484 | # 'creator' field set to None. This tests that behaviour when |
2485 | # the cloner is used to perform the initialization. |
2486 | - parent, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2487 | + parent, unused = self.setupParent(packages={'p1': '1.2'}) |
2488 | child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent]) |
2489 | self.factory.makeSourcePackagePublishingHistory(distroseries=child) |
2490 | self._fullInitialize([parent], child=child) |
2491 | @@ -1614,7 +1614,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2492 | # The new publishings, copied over from the parents, have their |
2493 | # 'creator' field set to None. This tests that behaviour when |
2494 | # the copier is used to perform the initialization. |
2495 | - parent, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2496 | + parent, unused = self.setupParent(packages={'p1': '1.2'}) |
2497 | child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent]) |
2498 | self._fullInitialize([parent], child=child) |
2499 | |
2500 | @@ -1626,8 +1626,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2501 | # IDS._has_same_parents_as_previous_series returns True if the |
2502 | # parents for the series to be initialized are the same as |
2503 | # previous_series' parents. |
2504 | - prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2505 | - prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2506 | + prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2507 | + prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2508 | child = self.setUpSeriesWithPreviousSeries( |
2509 | previous_parents=[prev_parent1, prev_parent2]) |
2510 | # The same parents can be explicitely set. |
2511 | @@ -1640,8 +1640,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2512 | # IDS._has_same_parents_as_previous_series returns True if the |
2513 | # parents for the series to be initialized are the same as |
2514 | # previous_series' parents. |
2515 | - prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2516 | - prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2517 | + prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2518 | + prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2519 | child = self.setUpSeriesWithPreviousSeries( |
2520 | previous_parents=[prev_parent1, prev_parent2]) |
2521 | # If no parents are provided, the parents from previous_series |
2522 | @@ -1654,8 +1654,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2523 | # IDS._has_same_parents_as_previous_series returns False if the |
2524 | # parents for the series to be initialized are *not* the same as |
2525 | # previous_series' parents. |
2526 | - prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2527 | - prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2528 | + prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2529 | + prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2530 | child = self.setUpSeriesWithPreviousSeries( |
2531 | previous_parents=[prev_parent1, prev_parent2]) |
2532 | parent3 = self.factory.makeDistroSeries() |
2533 | @@ -1668,24 +1668,24 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2534 | # Post-first initialization of a series with the same parents |
2535 | # than those of the previous_series causes a copy of |
2536 | # previous_series' DSDs. |
2537 | - prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2538 | - prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2539 | + prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2540 | + prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2541 | child = self.setUpSeriesWithPreviousSeries( |
2542 | previous_parents=[prev_parent1, prev_parent2]) |
2543 | self.factory.makeDistroSeriesDifference() |
2544 | self.factory.makeDistroSeriesDifference( |
2545 | derived_series=child.previous_series, |
2546 | - source_package_name_str=u'p1') |
2547 | + source_package_name_str='p1') |
2548 | self.factory.makeDistroSeriesDifference( |
2549 | derived_series=child.previous_series, |
2550 | - source_package_name_str=u'p2') |
2551 | + source_package_name_str='p2') |
2552 | dsd_source = getUtility(IDistroSeriesDifferenceSource) |
2553 | # No DSDs for the child yet. |
2554 | self.assertEqual(0, dsd_source.getForDistroSeries(child).count()) |
2555 | self._fullInitialize([], child=child) |
2556 | |
2557 | self.assertContentEqual( |
2558 | - [u'p1', u'p2'], |
2559 | + ['p1', 'p2'], |
2560 | [ |
2561 | diff.source_package_name.name |
2562 | for diff in dsd_source.getForDistroSeries(child)]) |
2563 | @@ -1704,8 +1704,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2564 | def test_initialization_first_deriv_create_dsdjs(self): |
2565 | # A first initialization of a series creates the creation |
2566 | # of the DSDJs with all the parents. |
2567 | - parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2568 | - parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2569 | + parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2570 | + parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2571 | child = self._fullInitialize([parent1, parent2]) |
2572 | |
2573 | self.assertNotEqual([], self.getWaitingJobs(child, 'p1', parent1)) |
2574 | @@ -1715,12 +1715,12 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2575 | # Post-first initialization of a series with different parents |
2576 | # than those of the previous_series creates the DSDJs to |
2577 | # compute the DSDs with the parents. |
2578 | - prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) |
2579 | - prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2580 | + prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2581 | + prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2582 | child = self.setUpSeriesWithPreviousSeries( |
2583 | previous_parents=[prev_parent1, prev_parent2]) |
2584 | parent3, unused = self.setupParent( |
2585 | - packages={u'p2': u'2.5', u'p3': u'1.1'}) |
2586 | + packages={'p2': '2.5', 'p3': '1.1'}) |
2587 | self._fullInitialize( |
2588 | [prev_parent1, prev_parent2, parent3], child=child) |
2589 | |
2590 | @@ -1736,16 +1736,16 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): |
2591 | # packagesets creates the DSDJs for the packages inside these |
2592 | # packagesets. |
2593 | prev_parent1, unused = self.setupParent( |
2594 | - packages={u'p1': u'1.2', u'p11': u'3.1'}) |
2595 | - prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) |
2596 | + packages={'p1': '1.2', 'p11': '3.1'}) |
2597 | + prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2598 | child = self.setUpSeriesWithPreviousSeries( |
2599 | previous_parents=[prev_parent1, prev_parent2]) |
2600 | test1 = getUtility(IPackagesetSet).new( |
2601 | - u'test1', u'test 1 packageset', child.previous_series.owner, |
2602 | + 'test1', 'test 1 packageset', child.previous_series.owner, |
2603 | distroseries=child.previous_series) |
2604 | test1.addSources('p1') |
2605 | parent3, unused = self.setupParent( |
2606 | - packages={u'p1': u'2.5', u'p3': u'4.4'}) |
2607 | + packages={'p1': '2.5', 'p3': '4.4'}) |
2608 | self._fullInitialize( |
2609 | [prev_parent1, prev_parent2, parent3], child=child, |
2610 | packagesets=(str(test1.id),)) |
2611 | diff --git a/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py b/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py |
2612 | index 166f5db..f296c35 100644 |
2613 | --- a/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py |
2614 | +++ b/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py |
2615 | @@ -71,7 +71,7 @@ class TestObsoleteDistroseries(TestCaseWithFactory): |
2616 | |
2617 | def setUp(self): |
2618 | """Set up test data common to all test cases.""" |
2619 | - super(TestObsoleteDistroseries, self).setUp() |
2620 | + super().setUp() |
2621 | self.warty = getUtility(IDistributionSet)['ubuntu']['warty'] |
2622 | |
2623 | # Re-process the returned list otherwise it ends up being a list |
2624 | diff --git a/lib/lp/soyuz/scripts/tests/test_populatearchive.py b/lib/lp/soyuz/scripts/tests/test_populatearchive.py |
2625 | index c3b810f..d2826a3 100644 |
2626 | --- a/lib/lp/soyuz/scripts/tests/test_populatearchive.py |
2627 | +++ b/lib/lp/soyuz/scripts/tests/test_populatearchive.py |
2628 | @@ -46,14 +46,14 @@ class TestPopulateArchiveScript(TestCaseWithFactory): |
2629 | |
2630 | layer = LaunchpadZopelessLayer |
2631 | expected_build_spns = [ |
2632 | - u'alsa-utils', u'cnews', u'evolution', u'libstdc++', |
2633 | - u'linux-source-2.6.15', u'netapplet'] |
2634 | + 'alsa-utils', 'cnews', 'evolution', 'libstdc++', |
2635 | + 'linux-source-2.6.15', 'netapplet'] |
2636 | expected_src_names = [ |
2637 | - u'alsa-utils 1.0.9a-4ubuntu1 in hoary', |
2638 | - u'cnews cr.g7-37 in hoary', u'evolution 1.0 in hoary', |
2639 | - u'libstdc++ b8p in hoary', |
2640 | - u'linux-source-2.6.15 2.6.15.3 in hoary', |
2641 | - u'netapplet 1.0-1 in hoary', u'pmount 0.1-2 in hoary'] |
2642 | + 'alsa-utils 1.0.9a-4ubuntu1 in hoary', |
2643 | + 'cnews cr.g7-37 in hoary', 'evolution 1.0 in hoary', |
2644 | + 'libstdc++ b8p in hoary', |
2645 | + 'linux-source-2.6.15 2.6.15.3 in hoary', |
2646 | + 'netapplet 1.0-1 in hoary', 'pmount 0.1-2 in hoary'] |
2647 | pending_statuses = ( |
2648 | PackagePublishingStatus.PENDING, |
2649 | PackagePublishingStatus.PUBLISHED) |
2650 | @@ -675,7 +675,7 @@ class TestPopulateArchiveScript(TestCaseWithFactory): |
2651 | archive=ubuntu.main_archive) |
2652 | sources = ubuntu.main_archive.getPublishedSources( |
2653 | distroseries=hoary, status=self.pending_statuses, |
2654 | - name=u'alsa-utils') |
2655 | + name='alsa-utils') |
2656 | for src in sources: |
2657 | if src.source_package_version != '2.0': |
2658 | src.supersede() |
2659 | diff --git a/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py b/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py |
2660 | index 50db145..c56a4ab 100644 |
2661 | --- a/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py |
2662 | +++ b/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py |
2663 | @@ -71,7 +71,7 @@ class TestScriptRunning(TestCaseWithFactory): |
2664 | layer = LaunchpadZopelessLayer |
2665 | |
2666 | def setUp(self): |
2667 | - super(TestScriptRunning, self).setUp() |
2668 | + super().setUp() |
2669 | self.publisher = SoyuzTestPublisher() |
2670 | self.publisher.prepareBreezyAutotest() |
2671 | |
2672 | diff --git a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py |
2673 | index 26b518e..24b2462 100644 |
2674 | --- a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py |
2675 | +++ b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py |
2676 | @@ -23,7 +23,7 @@ class TestRetryDepwait(TestCaseWithFactory): |
2677 | layer = ZopelessDatabaseLayer |
2678 | |
2679 | def setUp(self): |
2680 | - super(TestRetryDepwait, self).setUp() |
2681 | + super().setUp() |
2682 | self.chroot = getUtility(ILibraryFileAliasSet)[1] |
2683 | self.build = removeSecurityProxy( |
2684 | self.factory.makeBinaryPackageBuild( |
2685 | @@ -48,7 +48,7 @@ class TestRetryDepwait(TestCaseWithFactory): |
2686 | # Builds with unsatisfied dependencies are not retried. |
2687 | self.build.updateStatus( |
2688 | BuildStatus.MANUALDEPWAIT, |
2689 | - slave_status={'dependencies': u'something'}) |
2690 | + slave_status={'dependencies': 'something'}) |
2691 | self.assertStatusAfterLoop(BuildStatus.MANUALDEPWAIT) |
2692 | self.assertEqual(1, self.build.updateDependencies.call_count) |
2693 | |
2694 | diff --git a/lib/lp/soyuz/tests/test_archive.py b/lib/lp/soyuz/tests/test_archive.py |
2695 | index ac1fb04..9e7be9a 100644 |
2696 | --- a/lib/lp/soyuz/tests/test_archive.py |
2697 | +++ b/lib/lp/soyuz/tests/test_archive.py |
2698 | @@ -15,7 +15,6 @@ import os.path |
2699 | from aptsources.sourceslist import SourceEntry |
2700 | from pytz import UTC |
2701 | import responses |
2702 | -import six |
2703 | from six.moves.urllib.parse import urlsplit |
2704 | from storm.store import Store |
2705 | from testtools.matchers import ( |
2706 | @@ -1048,7 +1047,7 @@ class TestUpdatePackageDownloadCount(TestCaseWithFactory): |
2707 | layer = LaunchpadZopelessLayer |
2708 | |
2709 | def setUp(self): |
2710 | - super(TestUpdatePackageDownloadCount, self).setUp() |
2711 | + super().setUp() |
2712 | self.publisher = SoyuzTestPublisher() |
2713 | self.publisher.prepareBreezyAutotest() |
2714 | |
2715 | @@ -1155,7 +1154,7 @@ class TestProcessors(TestCaseWithFactory): |
2716 | |
2717 | def setUp(self): |
2718 | """Setup an archive with relevant publications.""" |
2719 | - super(TestProcessors, self).setUp(user='foo.bar@canonical.com') |
2720 | + super().setUp(user='foo.bar@canonical.com') |
2721 | self.publisher = SoyuzTestPublisher() |
2722 | self.publisher.prepareBreezyAutotest() |
2723 | self.archive = self.factory.makeArchive() |
2724 | @@ -1287,7 +1286,7 @@ class TestArchiveTokens(TestCaseWithFactory): |
2725 | layer = LaunchpadZopelessLayer |
2726 | |
2727 | def setUp(self): |
2728 | - super(TestArchiveTokens, self).setUp() |
2729 | + super().setUp() |
2730 | owner = self.factory.makePerson() |
2731 | self.private_ppa = self.factory.makeArchive(owner=owner, private=True) |
2732 | self.joe = self.factory.makePerson(name='joe') |
2733 | @@ -1454,7 +1453,7 @@ class TestGetBinaryPackageRelease(TestCaseWithFactory): |
2734 | |
2735 | def setUp(self): |
2736 | """Setup an archive with relevant publications.""" |
2737 | - super(TestGetBinaryPackageRelease, self).setUp() |
2738 | + super().setUp() |
2739 | self.publisher = SoyuzTestPublisher() |
2740 | self.publisher.prepareBreezyAutotest() |
2741 | |
2742 | @@ -1549,7 +1548,7 @@ class TestGetBinaryPackageReleaseByFileName(TestCaseWithFactory): |
2743 | |
2744 | def setUp(self): |
2745 | """Setup an archive with relevant publications.""" |
2746 | - super(TestGetBinaryPackageReleaseByFileName, self).setUp() |
2747 | + super().setUp() |
2748 | self.publisher = SoyuzTestPublisher() |
2749 | self.publisher.prepareBreezyAutotest() |
2750 | |
2751 | @@ -1730,7 +1729,7 @@ class TestBuildDebugSymbols(TestCaseWithFactory): |
2752 | layer = DatabaseFunctionalLayer |
2753 | |
2754 | def setUp(self): |
2755 | - super(TestBuildDebugSymbols, self).setUp() |
2756 | + super().setUp() |
2757 | self.archive = self.factory.makeArchive() |
2758 | |
2759 | def test_build_debug_symbols_is_public(self): |
2760 | @@ -1887,7 +1886,7 @@ class TestFindDepCandidates(TestCaseWithFactory): |
2761 | layer = LaunchpadZopelessLayer |
2762 | |
2763 | def setUp(self): |
2764 | - super(TestFindDepCandidates, self).setUp() |
2765 | + super().setUp() |
2766 | self.archive = self.factory.makeArchive() |
2767 | self.publisher = SoyuzTestPublisher() |
2768 | login('admin@canonical.com') |
2769 | @@ -2052,12 +2051,12 @@ class TestOverlays(TestCaseWithFactory): |
2770 | overlay=True, arch_tag='i386', |
2771 | publish_base_url='http://archive.launchpad.test/'): |
2772 | # Helper to create a parent/child relationship. |
2773 | - if isinstance(parent_distro, six.string_types): |
2774 | + if isinstance(parent_distro, str): |
2775 | depdistro = self.factory.makeDistribution(parent_distro, |
2776 | publish_base_url=publish_base_url) |
2777 | else: |
2778 | depdistro = parent_distro |
2779 | - if isinstance(parent_series, six.string_types): |
2780 | + if isinstance(parent_series, str): |
2781 | depseries = self.factory.makeDistroSeries( |
2782 | name=parent_series, distribution=depdistro) |
2783 | self.factory.makeDistroArchSeries( |
2784 | @@ -2195,7 +2194,7 @@ class TestValidatePPA(TestCaseWithFactory): |
2785 | layer = DatabaseFunctionalLayer |
2786 | |
2787 | def setUp(self): |
2788 | - super(TestValidatePPA, self).setUp() |
2789 | + super().setUp() |
2790 | self.ubuntu = getUtility(IDistributionSet)['ubuntu'] |
2791 | self.ubuntutest = getUtility(IDistributionSet)['ubuntutest'] |
2792 | with admin_logged_in(): |
2793 | @@ -2324,7 +2323,7 @@ class TestGetComponentsForSeries(TestCaseWithFactory): |
2794 | layer = DatabaseFunctionalLayer |
2795 | |
2796 | def setUp(self): |
2797 | - super(TestGetComponentsForSeries, self).setUp() |
2798 | + super().setUp() |
2799 | self.series = self.factory.makeDistroSeries() |
2800 | self.comp1 = self.factory.makeComponent() |
2801 | self.comp2 = self.factory.makeComponent() |
2802 | @@ -2401,7 +2400,7 @@ class TestGetFileByName(TestCaseWithFactory): |
2803 | layer = LaunchpadZopelessLayer |
2804 | |
2805 | def setUp(self): |
2806 | - super(TestGetFileByName, self).setUp() |
2807 | + super().setUp() |
2808 | self.archive = self.factory.makeArchive() |
2809 | |
2810 | def test_unknown_file_is_not_found(self): |
2811 | @@ -2510,7 +2509,7 @@ class TestGetSourceFileByName(TestCaseWithFactory): |
2812 | layer = LaunchpadZopelessLayer |
2813 | |
2814 | def setUp(self): |
2815 | - super(TestGetSourceFileByName, self).setUp() |
2816 | + super().setUp() |
2817 | self.archive = self.factory.makeArchive() |
2818 | |
2819 | def test_source_file_is_found(self): |
2820 | @@ -3701,7 +3700,7 @@ class TestGetPPAOwnedByPerson(TestCaseWithFactory): |
2821 | layer = DatabaseFunctionalLayer |
2822 | |
2823 | def setUp(self): |
2824 | - super(TestGetPPAOwnedByPerson, self).setUp() |
2825 | + super().setUp() |
2826 | self.set = getUtility(IArchiveSet) |
2827 | |
2828 | def test_person(self): |
2829 | @@ -3758,7 +3757,7 @@ class TestPPALookup(TestCaseWithFactory): |
2830 | layer = DatabaseFunctionalLayer |
2831 | |
2832 | def setUp(self): |
2833 | - super(TestPPALookup, self).setUp() |
2834 | + super().setUp() |
2835 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
2836 | self.notbuntu = self.factory.makeDistribution() |
2837 | self.person = self.factory.makePerson() |
2838 | @@ -3847,7 +3846,7 @@ class TestArchiveSetGetByReference(TestCaseWithFactory): |
2839 | layer = DatabaseFunctionalLayer |
2840 | |
2841 | def setUp(self): |
2842 | - super(TestArchiveSetGetByReference, self).setUp() |
2843 | + super().setUp() |
2844 | self.set = getUtility(IArchiveSet) |
2845 | |
2846 | def test_ppa(self): |
2847 | @@ -4206,7 +4205,7 @@ class TestArchiveGetOverridePolicy(TestCaseWithFactory): |
2848 | layer = DatabaseFunctionalLayer |
2849 | |
2850 | def setUp(self): |
2851 | - super(TestArchiveGetOverridePolicy, self).setUp() |
2852 | + super().setUp() |
2853 | self.series = self.factory.makeDistroSeries() |
2854 | with admin_logged_in(): |
2855 | self.series.nominatedarchindep = self.amd64 = ( |
2856 | diff --git a/lib/lp/soyuz/tests/test_archive_subscriptions.py b/lib/lp/soyuz/tests/test_archive_subscriptions.py |
2857 | index 04fa7bb..516fcd7 100644 |
2858 | --- a/lib/lp/soyuz/tests/test_archive_subscriptions.py |
2859 | +++ b/lib/lp/soyuz/tests/test_archive_subscriptions.py |
2860 | @@ -44,7 +44,7 @@ class TestArchiveSubscriptions(TestCaseWithFactory): |
2861 | |
2862 | def setUp(self): |
2863 | """Create a test archive.""" |
2864 | - super(TestArchiveSubscriptions, self).setUp() |
2865 | + super().setUp() |
2866 | self.owner = self.factory.makePerson() |
2867 | self.private_team = self.factory.makeTeam( |
2868 | visibility=PersonVisibility.PRIVATE, |
2869 | @@ -136,7 +136,7 @@ class PrivateArtifactsViewTestCase(BrowserTestCase): |
2870 | |
2871 | def setUp(self): |
2872 | """Create a test archive.""" |
2873 | - super(PrivateArtifactsViewTestCase, self).setUp() |
2874 | + super().setUp() |
2875 | self.owner = self.factory.makePerson() |
2876 | self.private_team = self.factory.makeTeam( |
2877 | visibility=PersonVisibility.PRIVATE, |
2878 | diff --git a/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py b/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py |
2879 | index ccec886..7fbccb3 100644 |
2880 | --- a/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py |
2881 | +++ b/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py |
2882 | @@ -18,7 +18,7 @@ class TestBinaryAndSourcePackageNameVocabulary(TestCaseWithFactory): |
2883 | layer = DatabaseFunctionalLayer |
2884 | |
2885 | def setUp(self): |
2886 | - super(TestBinaryAndSourcePackageNameVocabulary, self).setUp() |
2887 | + super().setUp() |
2888 | self.vocabulary = BinaryAndSourcePackageNameVocabulary() |
2889 | spn = self.factory.makeSourcePackageName(name='bedbugs') |
2890 | self.bspn = Store.of(spn).find( |
2891 | diff --git a/lib/lp/soyuz/tests/test_binarypackagebuild.py b/lib/lp/soyuz/tests/test_binarypackagebuild.py |
2892 | index 3a3f21a..9bfbb41 100644 |
2893 | --- a/lib/lp/soyuz/tests/test_binarypackagebuild.py |
2894 | +++ b/lib/lp/soyuz/tests/test_binarypackagebuild.py |
2895 | @@ -77,7 +77,7 @@ class TestBinaryPackageBuild(TestCaseWithFactory): |
2896 | layer = LaunchpadZopelessLayer |
2897 | |
2898 | def setUp(self): |
2899 | - super(TestBinaryPackageBuild, self).setUp() |
2900 | + super().setUp() |
2901 | self.build = self.factory.makeBinaryPackageBuild( |
2902 | archive=self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)) |
2903 | |
2904 | @@ -404,7 +404,7 @@ class BaseTestCaseWithThreeBuilds(TestCaseWithFactory): |
2905 | |
2906 | def setUp(self): |
2907 | """Publish some builds for the test archive.""" |
2908 | - super(BaseTestCaseWithThreeBuilds, self).setUp() |
2909 | + super().setUp() |
2910 | self.ds = self.factory.makeDistroSeries() |
2911 | i386_das = self.factory.makeDistroArchSeries( |
2912 | distroseries=self.ds, architecturetag='i386') |
2913 | @@ -457,7 +457,7 @@ class TestBuildSetGetBuildsForArchive(BaseTestCaseWithThreeBuilds): |
2914 | |
2915 | def setUp(self): |
2916 | """Publish some builds for the test archive.""" |
2917 | - super(TestBuildSetGetBuildsForArchive, self).setUp() |
2918 | + super().setUp() |
2919 | |
2920 | # Short-cuts for our tests. |
2921 | self.archive = self.ds.main_archive |
2922 | @@ -479,7 +479,7 @@ class TestBuildSetGetBuildsForArchive(BaseTestCaseWithThreeBuilds): |
2923 | class TestBuildSetGetBuildsForBuilder(BaseTestCaseWithThreeBuilds): |
2924 | |
2925 | def setUp(self): |
2926 | - super(TestBuildSetGetBuildsForBuilder, self).setUp() |
2927 | + super().setUp() |
2928 | |
2929 | # Short-cuts for our tests. |
2930 | self.build_set = getUtility(IBinaryPackageBuildSet) |
2931 | @@ -524,7 +524,7 @@ class TestBinaryPackageBuildWebservice(TestCaseWithFactory): |
2932 | layer = DatabaseFunctionalLayer |
2933 | |
2934 | def setUp(self): |
2935 | - super(TestBinaryPackageBuildWebservice, self).setUp() |
2936 | + super().setUp() |
2937 | self.ppa = self.factory.makeArchive(purpose=ArchivePurpose.PPA) |
2938 | self.build = self.factory.makeBinaryPackageBuild(archive=self.ppa) |
2939 | self.webservice = webservice_for_person( |
2940 | @@ -929,7 +929,7 @@ class TestBinaryPackageBuildMacaroonIssuer( |
2941 | layer = LaunchpadZopelessLayer |
2942 | |
2943 | def setUp(self): |
2944 | - super(TestBinaryPackageBuildMacaroonIssuer, self).setUp() |
2945 | + super().setUp() |
2946 | self.pushConfig( |
2947 | "launchpad", internal_macaroon_secret_key="some-secret") |
2948 | |
2949 | diff --git a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py |
2950 | index 5239946..4f06427 100644 |
2951 | --- a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py |
2952 | +++ b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py |
2953 | @@ -94,7 +94,7 @@ class TestBinaryBuildPackageBehaviour(StatsMixin, TestCaseWithFactory): |
2954 | timeout=30) |
2955 | |
2956 | def setUp(self): |
2957 | - super(TestBinaryBuildPackageBehaviour, self).setUp() |
2958 | + super().setUp() |
2959 | switch_dbuser('testadmin') |
2960 | self.setUpStats() |
2961 | |
2962 | @@ -534,7 +534,7 @@ class TestBinaryBuildPackageBehaviourBuildCollection(TestCaseWithFactory): |
2963 | shutil.rmtree(config.builddmaster.root) |
2964 | |
2965 | def setUp(self): |
2966 | - super(TestBinaryBuildPackageBehaviourBuildCollection, self).setUp() |
2967 | + super().setUp() |
2968 | switch_dbuser('testadmin') |
2969 | |
2970 | self.builder = self.factory.makeBuilder() |
2971 | diff --git a/lib/lp/soyuz/tests/test_binarypackagename.py b/lib/lp/soyuz/tests/test_binarypackagename.py |
2972 | index 9137864..e9564ee 100644 |
2973 | --- a/lib/lp/soyuz/tests/test_binarypackagename.py |
2974 | +++ b/lib/lp/soyuz/tests/test_binarypackagename.py |
2975 | @@ -17,7 +17,7 @@ class TestBinaryPackageNameSet(TestCaseWithFactory): |
2976 | layer = DatabaseFunctionalLayer |
2977 | |
2978 | def setUp(self): |
2979 | - super(TestBinaryPackageNameSet, self).setUp() |
2980 | + super().setUp() |
2981 | self.name_set = getUtility(IBinaryPackageNameSet) |
2982 | |
2983 | def test___getitem__found(self): |
2984 | diff --git a/lib/lp/soyuz/tests/test_binarysourcereference.py b/lib/lp/soyuz/tests/test_binarysourcereference.py |
2985 | index ddb05f8..944c35b 100644 |
2986 | --- a/lib/lp/soyuz/tests/test_binarysourcereference.py |
2987 | +++ b/lib/lp/soyuz/tests/test_binarysourcereference.py |
2988 | @@ -30,7 +30,7 @@ class TestBinarySourceReference(TestCaseWithFactory): |
2989 | layer = DatabaseFunctionalLayer |
2990 | |
2991 | def setUp(self): |
2992 | - super(TestBinarySourceReference, self).setUp() |
2993 | + super().setUp() |
2994 | self.reference_set = getUtility(IBinarySourceReferenceSet) |
2995 | |
2996 | def test_createFromRelationship_empty(self): |
2997 | diff --git a/lib/lp/soyuz/tests/test_build.py b/lib/lp/soyuz/tests/test_build.py |
2998 | index 8181a2d..36bb5a3 100644 |
2999 | --- a/lib/lp/soyuz/tests/test_build.py |
3000 | +++ b/lib/lp/soyuz/tests/test_build.py |
3001 | @@ -38,7 +38,7 @@ class TestBuild(TestCaseWithFactory): |
3002 | layer = LaunchpadFunctionalLayer |
3003 | |
3004 | def setUp(self): |
3005 | - super(TestBuild, self).setUp() |
3006 | + super().setUp() |
3007 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3008 | self.processor = self.factory.makeProcessor(supports_virtualized=True) |
3009 | self.distroseries = self.factory.makeDistroSeries() |
3010 | diff --git a/lib/lp/soyuz/tests/test_build_depwait.py b/lib/lp/soyuz/tests/test_build_depwait.py |
3011 | index dd57b39..f4d9567 100644 |
3012 | --- a/lib/lp/soyuz/tests/test_build_depwait.py |
3013 | +++ b/lib/lp/soyuz/tests/test_build_depwait.py |
3014 | @@ -25,7 +25,7 @@ class TestBuildDepWait(TestCaseWithFactory): |
3015 | layer = LaunchpadFunctionalLayer |
3016 | |
3017 | def setUp(self): |
3018 | - super(TestBuildDepWait, self).setUp() |
3019 | + super().setUp() |
3020 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3021 | # Create everything we need to create builds, such as a |
3022 | # DistroArchSeries and a builder. |
3023 | diff --git a/lib/lp/soyuz/tests/test_build_notify.py b/lib/lp/soyuz/tests/test_build_notify.py |
3024 | index 3621091..fa90f02 100644 |
3025 | --- a/lib/lp/soyuz/tests/test_build_notify.py |
3026 | +++ b/lib/lp/soyuz/tests/test_build_notify.py |
3027 | @@ -46,7 +46,7 @@ class TestBuildNotify(TestCaseWithFactory): |
3028 | layer = LaunchpadZopelessLayer |
3029 | |
3030 | def setUp(self): |
3031 | - super(TestBuildNotify, self).setUp() |
3032 | + super().setUp() |
3033 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3034 | # Create all of the items we need to create builds |
3035 | self.processor = self.factory.makeProcessor(supports_virtualized=True) |
3036 | diff --git a/lib/lp/soyuz/tests/test_build_privacy.py b/lib/lp/soyuz/tests/test_build_privacy.py |
3037 | index 3004a0d..85ebaaf 100644 |
3038 | --- a/lib/lp/soyuz/tests/test_build_privacy.py |
3039 | +++ b/lib/lp/soyuz/tests/test_build_privacy.py |
3040 | @@ -20,7 +20,7 @@ class TestBuildPrivacy(TestCaseWithFactory): |
3041 | layer = LaunchpadFunctionalLayer |
3042 | |
3043 | def setUp(self): |
3044 | - super(TestBuildPrivacy, self).setUp() |
3045 | + super().setUp() |
3046 | # Add everything we need to create builds. |
3047 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3048 | processor = self.factory.makeProcessor(supports_virtualized=True) |
3049 | diff --git a/lib/lp/soyuz/tests/test_build_set.py b/lib/lp/soyuz/tests/test_build_set.py |
3050 | index 84f57eb..6dcf9fd 100644 |
3051 | --- a/lib/lp/soyuz/tests/test_build_set.py |
3052 | +++ b/lib/lp/soyuz/tests/test_build_set.py |
3053 | @@ -42,7 +42,7 @@ class TestBuildSet(TestCaseWithFactory): |
3054 | layer = LaunchpadFunctionalLayer |
3055 | |
3056 | def setUp(self): |
3057 | - super(TestBuildSet, self).setUp() |
3058 | + super().setUp() |
3059 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3060 | self.processor_one = self.factory.makeProcessor( |
3061 | supports_virtualized=True) |
3062 | @@ -269,7 +269,7 @@ class TestGetAllowedArchitectures(TestCaseWithFactory): |
3063 | layer = ZopelessDatabaseLayer |
3064 | |
3065 | def setUp(self): |
3066 | - super(TestGetAllowedArchitectures, self).setUp() |
3067 | + super().setUp() |
3068 | self.avr = self.factory.makeProcessor( |
3069 | name="avr2001", supports_virtualized=True) |
3070 | self.sparc = self.factory.makeProcessor( |
3071 | @@ -347,7 +347,7 @@ class BuildRecordCreationTests(TestNativePublishingBase): |
3072 | """Test the creation of build records.""" |
3073 | |
3074 | def setUp(self): |
3075 | - super(BuildRecordCreationTests, self).setUp() |
3076 | + super().setUp() |
3077 | self.distro = self.factory.makeDistribution() |
3078 | self.avr = self.factory.makeProcessor( |
3079 | name="avr2001", supports_virtualized=True) |
3080 | @@ -386,7 +386,7 @@ class BuildRecordCreationTests(TestNativePublishingBase): |
3081 | :param architecturehintlist: Architecture hint list |
3082 | (e.g. "i386 amd64") |
3083 | """ |
3084 | - return super(BuildRecordCreationTests, self).getPubSource( |
3085 | + return super().getPubSource( |
3086 | archive=self.factory.makeArchive(), distroseries=self.distroseries, |
3087 | architecturehintlist=architecturehintlist) |
3088 | |
3089 | @@ -588,7 +588,7 @@ class TestFindBuiltOrPublishedBySourceAndArchive(TestCaseWithFactory): |
3090 | layer = ZopelessDatabaseLayer |
3091 | |
3092 | def setUp(self): |
3093 | - super(TestFindBuiltOrPublishedBySourceAndArchive, self).setUp() |
3094 | + super().setUp() |
3095 | self.bpbs = getUtility(IBinaryPackageBuildSet) |
3096 | |
3097 | def test_trivial(self): |
3098 | diff --git a/lib/lp/soyuz/tests/test_build_start_estimation.py b/lib/lp/soyuz/tests/test_build_start_estimation.py |
3099 | index b26dae1..07f625e 100644 |
3100 | --- a/lib/lp/soyuz/tests/test_build_start_estimation.py |
3101 | +++ b/lib/lp/soyuz/tests/test_build_start_estimation.py |
3102 | @@ -29,7 +29,7 @@ class TestBuildStartEstimation(TestCaseWithFactory): |
3103 | layer = LaunchpadFunctionalLayer |
3104 | |
3105 | def setUp(self): |
3106 | - super(TestBuildStartEstimation, self).setUp() |
3107 | + super().setUp() |
3108 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3109 | with person_logged_in(self.admin): |
3110 | self.publisher = SoyuzTestPublisher() |
3111 | diff --git a/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py b/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py |
3112 | index 5abdd67..38dcc3e 100644 |
3113 | --- a/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py |
3114 | +++ b/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py |
3115 | @@ -29,7 +29,7 @@ class TestDistributionSourcePackageRelease(TestCaseWithFactory): |
3116 | layer = DatabaseFunctionalLayer |
3117 | |
3118 | def setUp(self): |
3119 | - super(TestDistributionSourcePackageRelease, self).setUp() |
3120 | + super().setUp() |
3121 | self.sourcepackagerelease = self.factory.makeSourcePackageRelease() |
3122 | self.distroarchseries = self.factory.makeDistroArchSeries( |
3123 | distroseries=self.sourcepackagerelease.upload_distroseries) |
3124 | @@ -159,7 +159,7 @@ class TestGetBinariesForSeries(TestCaseWithFactory): |
3125 | layer = DatabaseFunctionalLayer |
3126 | |
3127 | def setUp(self): |
3128 | - super(TestGetBinariesForSeries, self).setUp() |
3129 | + super().setUp() |
3130 | self.sourcepackagerelease = self.factory.makeSourcePackageRelease() |
3131 | self.distroarchseries = self.factory.makeDistroArchSeries( |
3132 | distroseries=self.sourcepackagerelease.upload_distroseries) |
3133 | diff --git a/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py b/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py |
3134 | index 2b61058..682d7db 100644 |
3135 | --- a/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py |
3136 | +++ b/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py |
3137 | @@ -32,7 +32,7 @@ class TestDistroSeriesBinaryPackage(TestCaseWithFactory): |
3138 | |
3139 | def setUp(self): |
3140 | """Create a distroseriesbinarypackage to play with.""" |
3141 | - super(TestDistroSeriesBinaryPackage, self).setUp() |
3142 | + super().setUp() |
3143 | self.publisher = SoyuzTestPublisher() |
3144 | self.publisher.prepareBreezyAutotest() |
3145 | self.distroseries = self.publisher.distroseries |
3146 | diff --git a/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py b/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py |
3147 | index e9f007d..220fc9f 100644 |
3148 | --- a/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py |
3149 | +++ b/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py |
3150 | @@ -607,7 +607,7 @@ class TestDistroSeriesDifferenceJobEndToEnd(TestCaseWithFactory): |
3151 | layer = LaunchpadZopelessLayer |
3152 | |
3153 | def setUp(self): |
3154 | - super(TestDistroSeriesDifferenceJobEndToEnd, self).setUp() |
3155 | + super().setUp() |
3156 | self.store = IMasterStore(DistroSeriesDifference) |
3157 | |
3158 | def getJobSource(self): |
3159 | diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py b/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py |
3160 | index 5c41eac..3f1c664 100644 |
3161 | --- a/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py |
3162 | +++ b/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py |
3163 | @@ -34,7 +34,7 @@ from lp.testing.gpgkeys import import_public_test_keys |
3164 | class TestDistroSeriesQueueDdtpTarball(TestNativePublishingBase): |
3165 | |
3166 | def setUp(self): |
3167 | - super(TestDistroSeriesQueueDdtpTarball, self).setUp() |
3168 | + super().setUp() |
3169 | import_public_test_keys() |
3170 | # CustomUpload.installFiles requires a umask of 0o022. |
3171 | old_umask = os.umask(0o022) |
3172 | diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py b/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py |
3173 | index 326be48..3338d1a 100644 |
3174 | --- a/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py |
3175 | +++ b/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py |
3176 | @@ -27,7 +27,7 @@ from lp.testing.gpgkeys import import_public_test_keys |
3177 | class TestDistroSeriesQueueDebianInstaller(TestNativePublishingBase): |
3178 | |
3179 | def setUp(self): |
3180 | - super(TestDistroSeriesQueueDebianInstaller, self).setUp() |
3181 | + super().setUp() |
3182 | import_public_test_keys() |
3183 | # CustomUpload.installFiles requires a umask of 0o022. |
3184 | old_umask = os.umask(0o022) |
3185 | diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py b/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py |
3186 | index 6dac873..8620c42 100644 |
3187 | --- a/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py |
3188 | +++ b/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py |
3189 | @@ -30,7 +30,7 @@ from lp.testing.gpgkeys import import_public_test_keys |
3190 | class TestDistroSeriesQueueDistUpgrader(TestNativePublishingBase): |
3191 | |
3192 | def setUp(self): |
3193 | - super(TestDistroSeriesQueueDistUpgrader, self).setUp() |
3194 | + super().setUp() |
3195 | import_public_test_keys() |
3196 | # CustomUpload.installFiles requires a umask of 0o022. |
3197 | old_umask = os.umask(0o022) |
3198 | @@ -42,7 +42,7 @@ class TestDistroSeriesQueueDistUpgrader(TestNativePublishingBase): |
3199 | self.logger = DevNullLogger() |
3200 | |
3201 | def tearDown(self): |
3202 | - super(TestDistroSeriesQueueDistUpgrader, self).tearDown() |
3203 | + super().tearDown() |
3204 | if os.path.exists(config.personalpackagearchive.root): |
3205 | shutil.rmtree(config.personalpackagearchive.root) |
3206 | |
3207 | diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py b/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py |
3208 | index 7cfcf54..b13658b 100644 |
3209 | --- a/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py |
3210 | +++ b/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py |
3211 | @@ -51,7 +51,7 @@ class TestDistroSeriesQueueRosettaTranslationsTarball( |
3212 | layer = LaunchpadZopelessLayer |
3213 | |
3214 | def setUp(self): |
3215 | - super(TestDistroSeriesQueueRosettaTranslationsTarball, self).setUp() |
3216 | + super().setUp() |
3217 | import_public_test_keys() |
3218 | self.logger = DevNullLogger() |
3219 | self.absolutely_anything_policy = getPolicy( |
3220 | diff --git a/lib/lp/soyuz/tests/test_hasbuildrecords.py b/lib/lp/soyuz/tests/test_hasbuildrecords.py |
3221 | index 94c146b..bcb15f1 100644 |
3222 | --- a/lib/lp/soyuz/tests/test_hasbuildrecords.py |
3223 | +++ b/lib/lp/soyuz/tests/test_hasbuildrecords.py |
3224 | @@ -45,7 +45,7 @@ class TestHasBuildRecordsInterface(BaseTestCaseWithThreeBuilds): |
3225 | |
3226 | def setUp(self): |
3227 | """Use `SoyuzTestPublisher` to publish some sources in archives.""" |
3228 | - super(TestHasBuildRecordsInterface, self).setUp() |
3229 | + super().setUp() |
3230 | self.context = self.ds.distribution |
3231 | |
3232 | def testProvidesHasBuildRecords(self): |
3233 | @@ -73,7 +73,7 @@ class TestDistributionHasBuildRecords(TestCaseWithFactory): |
3234 | layer = LaunchpadZopelessLayer |
3235 | |
3236 | def setUp(self): |
3237 | - super(TestDistributionHasBuildRecords, self).setUp() |
3238 | + super().setUp() |
3239 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3240 | # Create the machinery we need to create builds, such as |
3241 | # DistroArchSeries and builders. |
3242 | @@ -127,7 +127,7 @@ class TestDistroSeriesHasBuildRecords(TestHasBuildRecordsInterface): |
3243 | """Test the DistroSeries implementation of IHasBuildRecords.""" |
3244 | |
3245 | def setUp(self): |
3246 | - super(TestDistroSeriesHasBuildRecords, self).setUp() |
3247 | + super().setUp() |
3248 | self.context = self.ds |
3249 | |
3250 | |
3251 | @@ -137,7 +137,7 @@ class TestDistroArchSeriesHasBuildRecords(TestDistributionHasBuildRecords): |
3252 | layer = LaunchpadZopelessLayer |
3253 | |
3254 | def setUp(self): |
3255 | - super(TestDistroArchSeriesHasBuildRecords, self).setUp() |
3256 | + super().setUp() |
3257 | |
3258 | def test_distroarchseries(self): |
3259 | # We can fetch builds records from a DistroArchSeries. |
3260 | @@ -161,7 +161,7 @@ class TestArchiveHasBuildRecords(TestHasBuildRecordsInterface): |
3261 | """Test the Archive implementation of IHasBuildRecords.""" |
3262 | |
3263 | def setUp(self): |
3264 | - super(TestArchiveHasBuildRecords, self).setUp() |
3265 | + super().setUp() |
3266 | |
3267 | self.context = self.ds.main_archive |
3268 | |
3269 | @@ -191,7 +191,7 @@ class TestBuilderHasBuildRecords(TestHasBuildRecordsInterface): |
3270 | """Test the Builder implementation of IHasBuildRecords.""" |
3271 | |
3272 | def setUp(self): |
3273 | - super(TestBuilderHasBuildRecords, self).setUp() |
3274 | + super().setUp() |
3275 | |
3276 | # Create a 386 builder |
3277 | self.context = self.factory.makeBuilder() |
3278 | @@ -237,7 +237,7 @@ class TestSourcePackageHasBuildRecords(TestHasBuildRecordsInterface): |
3279 | """Test the SourcePackage implementation of IHasBuildRecords.""" |
3280 | |
3281 | def setUp(self): |
3282 | - super(TestSourcePackageHasBuildRecords, self).setUp() |
3283 | + super().setUp() |
3284 | gedit_name = self.builds[0].source_package_release.sourcepackagename |
3285 | self.context = SourcePackage( |
3286 | gedit_name, self.builds[0].distro_arch_series.distroseries) |
3287 | diff --git a/lib/lp/soyuz/tests/test_livefs.py b/lib/lp/soyuz/tests/test_livefs.py |
3288 | index 427ff7d..9ccd18a 100644 |
3289 | --- a/lib/lp/soyuz/tests/test_livefs.py |
3290 | +++ b/lib/lp/soyuz/tests/test_livefs.py |
3291 | @@ -89,7 +89,7 @@ class TestLiveFS(TestCaseWithFactory): |
3292 | layer = DatabaseFunctionalLayer |
3293 | |
3294 | def setUp(self): |
3295 | - super(TestLiveFS, self).setUp() |
3296 | + super().setUp() |
3297 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3298 | |
3299 | def test_implements_interfaces(self): |
3300 | @@ -455,7 +455,7 @@ class TestLiveFSSet(TestCaseWithFactory): |
3301 | layer = DatabaseFunctionalLayer |
3302 | |
3303 | def setUp(self): |
3304 | - super(TestLiveFSSet, self).setUp() |
3305 | + super().setUp() |
3306 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3307 | |
3308 | def test_class_implements_interfaces(self): |
3309 | @@ -550,7 +550,7 @@ class TestLiveFSWebservice(TestCaseWithFactory): |
3310 | layer = DatabaseFunctionalLayer |
3311 | |
3312 | def setUp(self): |
3313 | - super(TestLiveFSWebservice, self).setUp() |
3314 | + super().setUp() |
3315 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3316 | self.person = self.factory.makePerson(displayname="Test Person") |
3317 | self.webservice = webservice_for_person( |
3318 | diff --git a/lib/lp/soyuz/tests/test_livefsbuild.py b/lib/lp/soyuz/tests/test_livefsbuild.py |
3319 | index 2a64479..d448344 100644 |
3320 | --- a/lib/lp/soyuz/tests/test_livefsbuild.py |
3321 | +++ b/lib/lp/soyuz/tests/test_livefsbuild.py |
3322 | @@ -110,7 +110,7 @@ class TestLiveFSBuild(TestCaseWithFactory): |
3323 | layer = LaunchpadZopelessLayer |
3324 | |
3325 | def setUp(self): |
3326 | - super(TestLiveFSBuild, self).setUp() |
3327 | + super().setUp() |
3328 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3329 | self.build = self.factory.makeLiveFSBuild() |
3330 | |
3331 | @@ -375,7 +375,7 @@ class TestLiveFSBuildSet(TestCaseWithFactory): |
3332 | layer = LaunchpadZopelessLayer |
3333 | |
3334 | def setUp(self): |
3335 | - super(TestLiveFSBuildSet, self).setUp() |
3336 | + super().setUp() |
3337 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3338 | |
3339 | def test_getByBuildFarmJob_works(self): |
3340 | @@ -407,7 +407,7 @@ class TestLiveFSBuildWebservice(TestCaseWithFactory): |
3341 | layer = LaunchpadFunctionalLayer |
3342 | |
3343 | def setUp(self): |
3344 | - super(TestLiveFSBuildWebservice, self).setUp() |
3345 | + super().setUp() |
3346 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3347 | self.person = self.factory.makePerson() |
3348 | self.webservice = webservice_for_person( |
3349 | @@ -599,7 +599,7 @@ class TestLiveFSBuildMacaroonIssuer(MacaroonTestMixin, TestCaseWithFactory): |
3350 | layer = LaunchpadZopelessLayer |
3351 | |
3352 | def setUp(self): |
3353 | - super(TestLiveFSBuildMacaroonIssuer, self).setUp() |
3354 | + super().setUp() |
3355 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3356 | self.pushConfig( |
3357 | "launchpad", internal_macaroon_secret_key="some-secret") |
3358 | diff --git a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py |
3359 | index 5a9bcc2..0c39013 100644 |
3360 | --- a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py |
3361 | +++ b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py |
3362 | @@ -65,7 +65,7 @@ class TestLiveFSBuildBehaviourBase(TestCaseWithFactory): |
3363 | layer = LaunchpadZopelessLayer |
3364 | |
3365 | def setUp(self): |
3366 | - super(TestLiveFSBuildBehaviourBase, self).setUp() |
3367 | + super().setUp() |
3368 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3369 | |
3370 | def makeJob(self, archive=None, pocket=PackagePublishingPocket.RELEASE, |
3371 | diff --git a/lib/lp/soyuz/tests/test_packagecopyjob.py b/lib/lp/soyuz/tests/test_packagecopyjob.py |
3372 | index 50a65c8..97781f1 100644 |
3373 | --- a/lib/lp/soyuz/tests/test_packagecopyjob.py |
3374 | +++ b/lib/lp/soyuz/tests/test_packagecopyjob.py |
3375 | @@ -185,7 +185,7 @@ class PlainPackageCopyJobTests(TestCaseWithFactory, LocalTestHelper): |
3376 | layer = LaunchpadZopelessLayer |
3377 | |
3378 | def setUp(self): |
3379 | - super(PlainPackageCopyJobTests, self).setUp() |
3380 | + super().setUp() |
3381 | self.publisher = SoyuzTestPublisher() |
3382 | self.publisher.prepareBreezyAutotest() |
3383 | self.distroseries = self.publisher.breezy_autotest |
3384 | @@ -1803,7 +1803,7 @@ class TestViaCelery(TestCaseWithFactory): |
3385 | layer = CeleryJobLayer |
3386 | |
3387 | def setUp(self): |
3388 | - super(TestViaCelery, self).setUp() |
3389 | + super().setUp() |
3390 | # Turn on Celery handling of PCJs and the resulting notification jobs. |
3391 | self.useFixture(FeatureFixture({ |
3392 | 'jobs.celery.enabled_classes': |
3393 | @@ -1811,7 +1811,7 @@ class TestViaCelery(TestCaseWithFactory): |
3394 | })) |
3395 | |
3396 | def tearDown(self): |
3397 | - super(TestViaCelery, self).tearDown() |
3398 | + super().tearDown() |
3399 | pop_remote_notifications() |
3400 | |
3401 | def test_run(self): |
3402 | diff --git a/lib/lp/soyuz/tests/test_packageset.py b/lib/lp/soyuz/tests/test_packageset.py |
3403 | index c84b2be..da91a35 100644 |
3404 | --- a/lib/lp/soyuz/tests/test_packageset.py |
3405 | +++ b/lib/lp/soyuz/tests/test_packageset.py |
3406 | @@ -35,7 +35,7 @@ class TestPackagesetSet(TestCaseWithFactory): |
3407 | layer = ZopelessDatabaseLayer |
3408 | |
3409 | def setUp(self): |
3410 | - super(TestPackagesetSet, self).setUp() |
3411 | + super().setUp() |
3412 | self.ps_set = getUtility(IPackagesetSet) |
3413 | |
3414 | def getUbuntu(self): |
3415 | @@ -223,7 +223,7 @@ class TestPackagesetSetPermissions(TestCaseWithFactory): |
3416 | layer = DatabaseFunctionalLayer |
3417 | |
3418 | def setUp(self): |
3419 | - super(TestPackagesetSetPermissions, self).setUp() |
3420 | + super().setUp() |
3421 | self.ps_set = getUtility(IPackagesetSet) |
3422 | |
3423 | def test_create_packageset_as_user(self): |
3424 | @@ -256,7 +256,7 @@ class TestPackageset(TestCaseWithFactory): |
3425 | |
3426 | def setUp(self): |
3427 | """Setup a distribution with multiple distroseries.""" |
3428 | - super(TestPackageset, self).setUp() |
3429 | + super().setUp() |
3430 | self.distribution = getUtility(IDistributionSet).getByName( |
3431 | 'ubuntu') |
3432 | self.distroseries_current = self.distribution.currentseries |
3433 | @@ -664,7 +664,7 @@ class TestPackagesetPermissions(TestCaseWithFactory): |
3434 | layer = DatabaseFunctionalLayer |
3435 | |
3436 | def setUp(self): |
3437 | - super(TestPackagesetPermissions, self).setUp() |
3438 | + super().setUp() |
3439 | self.person = self.factory.makePerson() |
3440 | self.person2 = self.factory.makePerson() |
3441 | self.packageset = self.factory.makePackageset(owner=self.person) |
3442 | @@ -723,7 +723,7 @@ class TestArchivePermissionSet(TestCaseWithFactory): |
3443 | layer = ZopelessDatabaseLayer |
3444 | |
3445 | def setUp(self): |
3446 | - super(TestArchivePermissionSet, self).setUp() |
3447 | + super().setUp() |
3448 | self.ap_set = getUtility(IArchivePermissionSet) |
3449 | self.archive = self.factory.makeArchive() |
3450 | self.packageset = self.factory.makePackageset() |
3451 | diff --git a/lib/lp/soyuz/tests/test_packageupload.py b/lib/lp/soyuz/tests/test_packageupload.py |
3452 | index 24fb049..24d21ca 100644 |
3453 | --- a/lib/lp/soyuz/tests/test_packageupload.py |
3454 | +++ b/lib/lp/soyuz/tests/test_packageupload.py |
3455 | @@ -85,11 +85,11 @@ class PackageUploadTestCase(TestCaseWithFactory): |
3456 | dbuser = config.uploadqueue.dbuser |
3457 | |
3458 | def setUp(self): |
3459 | - super(PackageUploadTestCase, self).setUp() |
3460 | + super().setUp() |
3461 | self.test_publisher = SoyuzTestPublisher() |
3462 | |
3463 | def tearDown(self): |
3464 | - super(PackageUploadTestCase, self).tearDown() |
3465 | + super().tearDown() |
3466 | if os.path.exists(config.personalpackagearchive.root): |
3467 | shutil.rmtree(config.personalpackagearchive.root) |
3468 | |
3469 | @@ -692,7 +692,7 @@ class TestPackageUploadSet(TestCaseWithFactory): |
3470 | layer = LaunchpadZopelessLayer |
3471 | |
3472 | def setUp(self): |
3473 | - super(TestPackageUploadSet, self).setUp() |
3474 | + super().setUp() |
3475 | self.upload_set = getUtility(IPackageUploadSet) |
3476 | |
3477 | def test_PackageUploadSet_implements_IPackageUploadSet(self): |
3478 | @@ -1013,7 +1013,7 @@ class TestPackageUploadWebservice(TestCaseWithFactory): |
3479 | layer = LaunchpadFunctionalLayer |
3480 | |
3481 | def setUp(self): |
3482 | - super(TestPackageUploadWebservice, self).setUp() |
3483 | + super().setUp() |
3484 | self.webservice = None |
3485 | self.distroseries = self.factory.makeDistroSeries() |
3486 | self.main = self.factory.makeComponent("main") |
3487 | diff --git a/lib/lp/soyuz/tests/test_processacceptedbugsjob.py b/lib/lp/soyuz/tests/test_processacceptedbugsjob.py |
3488 | index 1b7ab86..8d7255d 100644 |
3489 | --- a/lib/lp/soyuz/tests/test_processacceptedbugsjob.py |
3490 | +++ b/lib/lp/soyuz/tests/test_processacceptedbugsjob.py |
3491 | @@ -56,7 +56,7 @@ class TestBugIDsFromChangesFile(TestCaseWithFactory): |
3492 | dbuser = config.uploadqueue.dbuser |
3493 | |
3494 | def setUp(self): |
3495 | - super(TestBugIDsFromChangesFile, self).setUp() |
3496 | + super().setUp() |
3497 | self.changes = Changes({ |
3498 | 'Format': '1.8', |
3499 | 'Source': 'swat', |
3500 | @@ -260,7 +260,7 @@ class TestCloseBugIDsForSourcePackageRelease(TestCaseWithFactory): |
3501 | dbuser = config.IProcessAcceptedBugsJobSource.dbuser |
3502 | |
3503 | def setUp(self): |
3504 | - super(TestCloseBugIDsForSourcePackageRelease, self).setUp() |
3505 | + super().setUp() |
3506 | # Create a distribution with two series, two source package names, |
3507 | # and an SPR and a bug task for all combinations of those. |
3508 | self.distro = self.factory.makeDistribution() |
3509 | @@ -324,7 +324,7 @@ class TestProcessAcceptedBugsJob(TestCaseWithFactory): |
3510 | dbuser = config.IProcessAcceptedBugsJobSource.dbuser |
3511 | |
3512 | def setUp(self): |
3513 | - super(TestProcessAcceptedBugsJob, self).setUp() |
3514 | + super().setUp() |
3515 | self.publisher = SoyuzTestPublisher() |
3516 | self.publisher.prepareBreezyAutotest() |
3517 | self.distroseries = self.publisher.breezy_autotest |
3518 | diff --git a/lib/lp/soyuz/tests/test_publishing.py b/lib/lp/soyuz/tests/test_publishing.py |
3519 | index ec6f426..fbb19f0 100644 |
3520 | --- a/lib/lp/soyuz/tests/test_publishing.py |
3521 | +++ b/lib/lp/soyuz/tests/test_publishing.py |
3522 | @@ -592,12 +592,12 @@ class TestNativePublishingBase(TestCaseWithFactory, SoyuzTestPublisher): |
3523 | dbuser = config.archivepublisher.dbuser |
3524 | |
3525 | def __init__(self, methodName='runTest'): |
3526 | - super(TestNativePublishingBase, self).__init__(methodName=methodName) |
3527 | + super().__init__(methodName=methodName) |
3528 | SoyuzTestPublisher.__init__(self) |
3529 | |
3530 | def setUp(self): |
3531 | """Setup a pool dir, the librarian, and instantiate the DiskPool.""" |
3532 | - super(TestNativePublishingBase, self).setUp() |
3533 | + super().setUp() |
3534 | switch_dbuser(config.archivepublisher.dbuser) |
3535 | self.prepareBreezyAutotest() |
3536 | self.config = getPubConfig(self.ubuntutest.main_archive) |
3537 | @@ -609,7 +609,7 @@ class TestNativePublishingBase(TestCaseWithFactory, SoyuzTestPublisher): |
3538 | |
3539 | def tearDown(self): |
3540 | """Tear down blows the pool dirs away.""" |
3541 | - super(TestNativePublishingBase, self).tearDown() |
3542 | + super().tearDown() |
3543 | for root in ( |
3544 | self.config.distroroot, |
3545 | config.personalpackagearchive.root, |
3546 | @@ -862,7 +862,7 @@ class PublishingSetTests(TestCaseWithFactory): |
3547 | layer = DatabaseFunctionalLayer |
3548 | |
3549 | def setUp(self): |
3550 | - super(PublishingSetTests, self).setUp() |
3551 | + super().setUp() |
3552 | self.distroseries = self.factory.makeDistroSeries() |
3553 | self.archive = self.factory.makeArchive( |
3554 | distribution=self.distroseries.distribution) |
3555 | @@ -919,7 +919,7 @@ class TestPublishingSetLite(TestCaseWithFactory): |
3556 | layer = ZopelessDatabaseLayer |
3557 | |
3558 | def setUp(self): |
3559 | - super(TestPublishingSetLite, self).setUp() |
3560 | + super().setUp() |
3561 | self.person = self.factory.makePerson() |
3562 | |
3563 | def test_requestDeletion_marks_SPPHs_deleted(self): |
3564 | diff --git a/lib/lp/soyuz/tests/test_publishing_models.py b/lib/lp/soyuz/tests/test_publishing_models.py |
3565 | index f91efa4..8fd922b 100644 |
3566 | --- a/lib/lp/soyuz/tests/test_publishing_models.py |
3567 | +++ b/lib/lp/soyuz/tests/test_publishing_models.py |
3568 | @@ -41,7 +41,7 @@ class TestPublishingSet(BaseTestCaseWithThreeBuilds): |
3569 | |
3570 | def setUp(self): |
3571 | """Use `SoyuzTestPublisher` to publish some sources in archives.""" |
3572 | - super(TestPublishingSet, self).setUp() |
3573 | + super().setUp() |
3574 | |
3575 | # Ensure all the builds have been built. |
3576 | for build in self.builds: |
3577 | diff --git a/lib/lp/soyuz/wsgi/tests/test_archiveauth.py b/lib/lp/soyuz/wsgi/tests/test_archiveauth.py |
3578 | index e1149da..fe2088f 100644 |
3579 | --- a/lib/lp/soyuz/wsgi/tests/test_archiveauth.py |
3580 | +++ b/lib/lp/soyuz/wsgi/tests/test_archiveauth.py |
3581 | @@ -26,7 +26,7 @@ class TestWSGIArchiveAuth(TestCaseWithFactory): |
3582 | layer = ZopelessAppServerLayer |
3583 | |
3584 | def setUp(self): |
3585 | - super(TestWSGIArchiveAuth, self).setUp() |
3586 | + super().setUp() |
3587 | self.now = time.time() |
3588 | self.useFixture(MonkeyPatch("time.time", lambda: self.now)) |
3589 | self.memcache_fixture = self.useFixture(MemcacheFixture()) |
3590 | diff --git a/lib/lp/soyuz/xmlrpc/tests/test_archive.py b/lib/lp/soyuz/xmlrpc/tests/test_archive.py |
3591 | index d34a879..e487a22 100644 |
3592 | --- a/lib/lp/soyuz/xmlrpc/tests/test_archive.py |
3593 | +++ b/lib/lp/soyuz/xmlrpc/tests/test_archive.py |
3594 | @@ -22,7 +22,7 @@ class TestArchiveAPI(TestCaseWithFactory): |
3595 | layer = LaunchpadFunctionalLayer |
3596 | |
3597 | def setUp(self): |
3598 | - super(TestArchiveAPI, self).setUp() |
3599 | + super().setUp() |
3600 | self.useFixture(FeatureFixture({NAMED_AUTH_TOKEN_FEATURE_FLAG: "on"})) |
3601 | self.archive_api = ArchiveAPI(None, None) |
3602 | self.pushConfig( |
Self-approving (mechanical).