Merge ~cjwatson/launchpad:pyupgrade-py3-coop-oci into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: f2edab727f50c25f1e84aa13c4bd7b39cf5200a6
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:pyupgrade-py3-coop-oci
Merge into: launchpad:master
Diff against target: 1076 lines (+110/-116)
29 files modified
.git-blame-ignore-revs (+2/-0)
.pre-commit-config.yaml (+2/-0)
lib/lp/coop/answersbugs/tests/test_doc.py (+2/-2)
lib/lp/oci/browser/ocirecipe.py (+20/-21)
lib/lp/oci/browser/ocirecipebuild.py (+1/-1)
lib/lp/oci/browser/ocirecipesubscription.py (+2/-2)
lib/lp/oci/browser/tests/test_ocirecipe.py (+11/-11)
lib/lp/oci/browser/tests/test_ocirecipebuild.py (+3/-3)
lib/lp/oci/browser/tests/test_ocirecipesubscription.py (+1/-1)
lib/lp/oci/interfaces/ocipushrule.py (+1/-1)
lib/lp/oci/interfaces/ocirecipe.py (+7/-8)
lib/lp/oci/interfaces/ociregistryclient.py (+1/-1)
lib/lp/oci/interfaces/ociregistrycredentials.py (+1/-1)
lib/lp/oci/model/ocirecipe.py (+2/-4)
lib/lp/oci/model/ocirecipebuild.py (+2/-2)
lib/lp/oci/model/ocirecipebuildbehaviour.py (+2/-3)
lib/lp/oci/model/ocirecipebuildjob.py (+3/-3)
lib/lp/oci/model/ocirecipejob.py (+2/-2)
lib/lp/oci/model/ocirecipesubscription.py (+1/-1)
lib/lp/oci/model/ociregistryclient.py (+3/-3)
lib/lp/oci/tests/helpers.py (+1/-1)
lib/lp/oci/tests/test_ocipushrule.py (+2/-2)
lib/lp/oci/tests/test_ocirecipe.py (+11/-14)
lib/lp/oci/tests/test_ocirecipebuild.py (+7/-8)
lib/lp/oci/tests/test_ocirecipebuildbehaviour.py (+6/-6)
lib/lp/oci/tests/test_ocirecipebuildjob.py (+5/-6)
lib/lp/oci/tests/test_ocirecipejob.py (+1/-1)
lib/lp/oci/tests/test_ociregistryclient.py (+6/-6)
lib/lp/oci/tests/test_ociregistrycredentials.py (+2/-2)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+413412@code.launchpad.net

Commit message

lp.{coop,oci}: Apply "pyupgrade --py3-plus"

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

Self-approving (mechanical).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index 2e06d20..a251b8f 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -26,3 +26,5 @@ b6725842a2470e3927bb73bf400c4476a06ee3ba
26cee9b128d3e49ca814464eeeeec50e6bcabcc4ba26cee9b128d3e49ca814464eeeeec50e6bcabcc4ba
27# apply pyupgrade --py3-plus to lp.codehosting27# apply pyupgrade --py3-plus to lp.codehosting
28f36fe66e5e5a5e82ba8c3269e32d76bd573d117528f36fe66e5e5a5e82ba8c3269e32d76bd573d1175
29# apply pyupgrade --py3-plus to lp.{coop,oci}
30fbed83f22424df8fa5647349493f78937a520db5
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 77a3d08..22c2329 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -50,6 +50,8 @@ repos:
50 |charms50 |charms
51 |code51 |code
52 |codehosting52 |codehosting
53 |coop
54 |oci
53 )/55 )/
54- repo: https://github.com/PyCQA/isort56- repo: https://github.com/PyCQA/isort
55 rev: 5.9.257 rev: 5.9.2
diff --git a/lib/lp/coop/answersbugs/tests/test_doc.py b/lib/lp/coop/answersbugs/tests/test_doc.py
index a917db1..a3e2eb0 100644
--- a/lib/lp/coop/answersbugs/tests/test_doc.py
+++ b/lib/lp/coop/answersbugs/tests/test_doc.py
@@ -54,8 +54,8 @@ def _createUbuntuBugTaskLinkedToQuestion():
54 ubuntu = getUtility(IDistributionSet).getByName('ubuntu')54 ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
55 ubuntu.addAnswerContact(ubuntu_team, ubuntu_team.teamowner)55 ubuntu.addAnswerContact(ubuntu_team, ubuntu_team.teamowner)
56 ubuntu_question = ubuntu.newQuestion(56 ubuntu_question = ubuntu.newQuestion(
57 sample_person, u"Can't install Ubuntu",57 sample_person, "Can't install Ubuntu",
58 u"I insert the install CD in the CD-ROM drive, but it won't boot.")58 "I insert the install CD in the CD-ROM drive, but it won't boot.")
59 no_priv = getUtility(IPersonSet).getByEmail('no-priv@canonical.com')59 no_priv = getUtility(IPersonSet).getByEmail('no-priv@canonical.com')
60 params = CreateBugParams(60 params = CreateBugParams(
61 owner=no_priv, title="Installer fails on a Mac PPC",61 owner=no_priv, title="Installer fails on a Mac PPC",
diff --git a/lib/lp/oci/browser/ocirecipe.py b/lib/lp/oci/browser/ocirecipe.py
index 3b12dff..7329652 100644
--- a/lib/lp/oci/browser/ocirecipe.py
+++ b/lib/lp/oci/browser/ocirecipe.py
@@ -20,7 +20,6 @@ from lazr.restful.interface import (
20 copy_field,20 copy_field,
21 use_template,21 use_template,
22 )22 )
23import six
24from zope.component import getUtility23from zope.component import getUtility
25from zope.formlib.form import FormFields24from zope.formlib.form import FormFields
26from zope.formlib.textwidgets import TextAreaWidget25from zope.formlib.textwidgets import TextAreaWidget
@@ -448,7 +447,7 @@ class OCIRecipeEditPushRulesView(LaunchpadFormView):
448 return field_type, rule_id447 return field_type, rule_id
449448
450 def setUpFields(self):449 def setUpFields(self):
451 super(OCIRecipeEditPushRulesView, self).setUpFields()450 super().setUpFields()
452 image_name_fields = []451 image_name_fields = []
453 url_fields = []452 url_fields = []
454 region_fields = []453 region_fields = []
@@ -510,7 +509,7 @@ class OCIRecipeEditPushRulesView(LaunchpadFormView):
510 required=True, readonly=False))509 required=True, readonly=False))
511 image_name_fields.append(510 image_name_fields.append(
512 TextLine(511 TextLine(
513 __name__=u'add_image_name',512 __name__='add_image_name',
514 required=False, readonly=False))513 required=False, readonly=False))
515 add_credentials = Choice(514 add_credentials = Choice(
516 __name__='add_credentials',515 __name__='add_credentials',
@@ -519,26 +518,26 @@ class OCIRecipeEditPushRulesView(LaunchpadFormView):
519 existing_credentials = Choice(518 existing_credentials = Choice(
520 vocabulary='OCIRegistryCredentials',519 vocabulary='OCIRegistryCredentials',
521 required=False,520 required=False,
522 __name__=u'existing_credentials')521 __name__='existing_credentials')
523 url_fields.append(522 url_fields.append(
524 TextLine(523 TextLine(
525 __name__=u'add_url',524 __name__='add_url',
526 required=False, readonly=False))525 required=False, readonly=False))
527 region_fields.append(526 region_fields.append(
528 TextLine(527 TextLine(
529 __name__=u'add_region',528 __name__='add_region',
530 required=False, readonly=False))529 required=False, readonly=False))
531 username_fields.append(530 username_fields.append(
532 TextLine(531 TextLine(
533 __name__=u'add_username',532 __name__='add_username',
534 required=False, readonly=False))533 required=False, readonly=False))
535 password_fields.append(534 password_fields.append(
536 Password(535 Password(
537 __name__=u'add_password',536 __name__='add_password',
538 required=False, readonly=False))537 required=False, readonly=False))
539 password_fields.append(538 password_fields.append(
540 Password(539 Password(
541 __name__=u'add_confirm_password',540 __name__='add_confirm_password',
542 required=False, readonly=False))541 required=False, readonly=False))
543542
544 self.form_fields = (543 self.form_fields = (
@@ -561,7 +560,7 @@ class OCIRecipeEditPushRulesView(LaunchpadFormView):
561560
562 def setUpWidgets(self, context=None):561 def setUpWidgets(self, context=None):
563 """See `LaunchpadFormView`."""562 """See `LaunchpadFormView`."""
564 super(OCIRecipeEditPushRulesView, self).setUpWidgets(context=context)563 super().setUpWidgets(context=context)
565 for widget in self.widgets:564 for widget in self.widgets:
566 widget.display_label = False565 widget.display_label = False
567 widget.hint = None566 widget.hint = None
@@ -846,7 +845,7 @@ class OCIRecipeFormMixin:
846 default = ""845 default = ""
847 return FormFields(Text(846 return FormFields(Text(
848 __name__='build_args',847 __name__='build_args',
849 title=u'Build-time ARG variables',848 title='Build-time ARG variables',
850 description=("One per line. Each ARG should be in the format "849 description=("One per line. Each ARG should be in the format "
851 "of ARG_KEY=arg_value."),850 "of ARG_KEY=arg_value."),
852 default=default,851 default=default,
@@ -861,7 +860,7 @@ class OCIRecipeFormMixin:
861 if '=' not in line:860 if '=' not in line:
862 msg = ("'%s' at line %s is not a valid KEY=value pair." %861 msg = ("'%s' at line %s is not a valid KEY=value pair." %
863 (line, i + 1))862 (line, i + 1))
864 self.setFieldError("build_args", six.text_type(msg))863 self.setFieldError("build_args", str(msg))
865 return864 return
866 k, v = line.split('=', 1)865 k, v = line.split('=', 1)
867 build_args[k] = v866 build_args[k] = v
@@ -919,13 +918,13 @@ class OCIRecipeAddView(LaunchpadFormView, EnableProcessorsMixin,
919 custom_widget_git_ref = GitRefWidget918 custom_widget_git_ref = GitRefWidget
920919
921 def initialize(self):920 def initialize(self):
922 super(OCIRecipeAddView, self).initialize()921 super().initialize()
923 if not getFeatureFlag(OCI_RECIPE_ALLOW_CREATE):922 if not getFeatureFlag(OCI_RECIPE_ALLOW_CREATE):
924 raise OCIRecipeFeatureDisabled()923 raise OCIRecipeFeatureDisabled()
925924
926 def setUpFields(self):925 def setUpFields(self):
927 """See `LaunchpadFormView`."""926 """See `LaunchpadFormView`."""
928 super(OCIRecipeAddView, self).setUpFields()927 super().setUpFields()
929 self.form_fields += self.createBuildArgsField()928 self.form_fields += self.createBuildArgsField()
930 self.form_fields += self.createEnabledProcessors(929 self.form_fields += self.createEnabledProcessors(
931 getUtility(IProcessorSet).getAll(),930 getUtility(IProcessorSet).getAll(),
@@ -945,7 +944,7 @@ class OCIRecipeAddView(LaunchpadFormView, EnableProcessorsMixin,
945 if self.distribution_has_credentials:944 if self.distribution_has_credentials:
946 self.form_fields += FormFields(TextLine(945 self.form_fields += FormFields(TextLine(
947 __name__='image_name',946 __name__='image_name',
948 title=u"Image name",947 title="Image name",
949 description=(948 description=(
950 "Name to use for registry upload. "949 "Name to use for registry upload. "
951 "Defaults to the name of the recipe."),950 "Defaults to the name of the recipe."),
@@ -976,7 +975,7 @@ class OCIRecipeAddView(LaunchpadFormView, EnableProcessorsMixin,
976975
977 def setUpWidgets(self):976 def setUpWidgets(self):
978 """See `LaunchpadFormView`."""977 """See `LaunchpadFormView`."""
979 super(OCIRecipeAddView, self).setUpWidgets()978 super().setUpWidgets()
980 self.setUpInformationTypeWidget()979 self.setUpInformationTypeWidget()
981 self.widgets["processors"].widget_class = "processors"980 self.widgets["processors"].widget_class = "processors"
982 self.setUpGitRefWidget()981 self.setUpGitRefWidget()
@@ -1005,7 +1004,7 @@ class OCIRecipeAddView(LaunchpadFormView, EnableProcessorsMixin,
10051004
1006 def validate(self, data):1005 def validate(self, data):
1007 """See `LaunchpadFormView`."""1006 """See `LaunchpadFormView`."""
1008 super(OCIRecipeAddView, self).validate(data)1007 super().validate(data)
1009 owner = data.get("owner", None)1008 owner = data.get("owner", None)
1010 name = data.get("name", None)1009 name = data.get("name", None)
1011 if owner and name:1010 if owner and name:
@@ -1137,7 +1136,7 @@ class OCIRecipeEditView(BaseOCIRecipeEditView, EnableProcessorsMixin,
11371136
1138 def setUpWidgets(self):1137 def setUpWidgets(self):
1139 """See `LaunchpadFormView`."""1138 """See `LaunchpadFormView`."""
1140 super(OCIRecipeEditView, self).setUpWidgets()1139 super().setUpWidgets()
1141 self.setUpInformationTypeWidget()1140 self.setUpInformationTypeWidget()
1142 self.setUpGitRefWidget()1141 self.setUpGitRefWidget()
1143 # disable the official recipe button if the user doesn't have1142 # disable the official recipe button if the user doesn't have
@@ -1148,7 +1147,7 @@ class OCIRecipeEditView(BaseOCIRecipeEditView, EnableProcessorsMixin,
11481147
1149 def setUpFields(self):1148 def setUpFields(self):
1150 """See `LaunchpadFormView`."""1149 """See `LaunchpadFormView`."""
1151 super(OCIRecipeEditView, self).setUpFields()1150 super().setUpFields()
1152 self.form_fields += self.createBuildArgsField()1151 self.form_fields += self.createBuildArgsField()
1153 self.form_fields += self.createEnabledProcessors(1152 self.form_fields += self.createEnabledProcessors(
1154 self.context.available_processors,1153 self.context.available_processors,
@@ -1168,7 +1167,7 @@ class OCIRecipeEditView(BaseOCIRecipeEditView, EnableProcessorsMixin,
1168 if self.distribution_has_credentials:1167 if self.distribution_has_credentials:
1169 self.form_fields += FormFields(TextLine(1168 self.form_fields += FormFields(TextLine(
1170 __name__='image_name',1169 __name__='image_name',
1171 title=u"Image name",1170 title="Image name",
1172 description=(1171 description=(
1173 "Name to use for registry upload. "1172 "Name to use for registry upload. "
1174 "Defaults to the name of the recipe."),1173 "Defaults to the name of the recipe."),
@@ -1177,7 +1176,7 @@ class OCIRecipeEditView(BaseOCIRecipeEditView, EnableProcessorsMixin,
11771176
1178 def validate(self, data):1177 def validate(self, data):
1179 """See `LaunchpadFormView`."""1178 """See `LaunchpadFormView`."""
1180 super(OCIRecipeEditView, self).validate(data)1179 super().validate(data)
1181 # XXX cjwatson 2020-02-18: We should permit and check moving recipes1180 # XXX cjwatson 2020-02-18: We should permit and check moving recipes
1182 # between OCI projects too.1181 # between OCI projects too.
1183 owner = data.get("owner", None)1182 owner = data.get("owner", None)
diff --git a/lib/lp/oci/browser/ocirecipebuild.py b/lib/lp/oci/browser/ocirecipebuild.py
index bdc63ad..9f1d55e 100644
--- a/lib/lp/oci/browser/ocirecipebuild.py
+++ b/lib/lp/oci/browser/ocirecipebuild.py
@@ -166,7 +166,7 @@ class OCIRecipeBuildRescoreView(LaunchpadFormView):
166166
167 def __call__(self):167 def __call__(self):
168 if self.context.can_be_rescored:168 if self.context.can_be_rescored:
169 return super(OCIRecipeBuildRescoreView, self).__call__()169 return super().__call__()
170 self.request.response.addWarningNotification(170 self.request.response.addWarningNotification(
171 "Cannot rescore this build because it is not queued.")171 "Cannot rescore this build because it is not queued.")
172 self.request.response.redirect(canonical_url(self.context))172 self.request.response.redirect(canonical_url(self.context))
diff --git a/lib/lp/oci/browser/ocirecipesubscription.py b/lib/lp/oci/browser/ocirecipesubscription.py
index 4edf12e..c4f016f 100644
--- a/lib/lp/oci/browser/ocirecipesubscription.py
+++ b/lib/lp/oci/browser/ocirecipesubscription.py
@@ -94,7 +94,7 @@ class OCIRecipeSubscriptionEditView(RedirectToOCIRecipeMixin,
94 def initialize(self):94 def initialize(self):
95 self.ocirecipe = self.context.recipe95 self.ocirecipe = self.context.recipe
96 self.person = self.context.person96 self.person = self.context.person
97 super(OCIRecipeSubscriptionEditView, self).initialize()97 super().initialize()
9898
99 @action("Unsubscribe", name="unsubscribe")99 @action("Unsubscribe", name="unsubscribe")
100 def unsubscribe_action(self, action, data):100 def unsubscribe_action(self, action, data):
@@ -114,7 +114,7 @@ class _OCIRecipeSubscriptionCreationView(RedirectToOCIRecipeMixin,
114114
115 def initialize(self):115 def initialize(self):
116 self.ocirecipe = self.context116 self.ocirecipe = self.context
117 super(_OCIRecipeSubscriptionCreationView, self).initialize()117 super().initialize()
118118
119119
120class OCIRecipeSubscriptionAddView(_OCIRecipeSubscriptionCreationView):120class OCIRecipeSubscriptionAddView(_OCIRecipeSubscriptionCreationView):
diff --git a/lib/lp/oci/browser/tests/test_ocirecipe.py b/lib/lp/oci/browser/tests/test_ocirecipe.py
index 0479b15..9b17ee7 100644
--- a/lib/lp/oci/browser/tests/test_ocirecipe.py
+++ b/lib/lp/oci/browser/tests/test_ocirecipe.py
@@ -101,7 +101,7 @@ class TestOCIRecipeNavigation(TestCaseWithFactory):
101 layer = DatabaseFunctionalLayer101 layer = DatabaseFunctionalLayer
102102
103 def setUp(self):103 def setUp(self):
104 super(TestOCIRecipeNavigation, self).setUp()104 super().setUp()
105 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))105 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
106106
107 def test_canonical_url(self):107 def test_canonical_url(self):
@@ -144,7 +144,7 @@ class BaseTestOCIRecipeView(BrowserTestCase):
144 layer = LaunchpadFunctionalLayer144 layer = LaunchpadFunctionalLayer
145145
146 def setUp(self):146 def setUp(self):
147 super(BaseTestOCIRecipeView, self).setUp()147 super().setUp()
148 self.useFixture(FakeLogger())148 self.useFixture(FakeLogger())
149 self.person = self.factory.makePerson(149 self.person = self.factory.makePerson(
150 name="test-person", displayname="Test Person")150 name="test-person", displayname="Test Person")
@@ -153,7 +153,7 @@ class BaseTestOCIRecipeView(BrowserTestCase):
153class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):153class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
154154
155 def setUp(self):155 def setUp(self):
156 super(TestOCIRecipeAddView, self).setUp()156 super().setUp()
157 self.distroseries = self.factory.makeDistroSeries()157 self.distroseries = self.factory.makeDistroSeries()
158 self.distribution = self.distroseries.distribution158 self.distribution = self.distroseries.distribution
159 self.useFixture(FeatureFixture({159 self.useFixture(FeatureFixture({
@@ -539,7 +539,7 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
539class TestOCIRecipeAdminView(BaseTestOCIRecipeView):539class TestOCIRecipeAdminView(BaseTestOCIRecipeView):
540540
541 def setUp(self):541 def setUp(self):
542 super(TestOCIRecipeAdminView, self).setUp()542 super().setUp()
543 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))543 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
544544
545 def test_unauthorized(self):545 def test_unauthorized(self):
@@ -594,7 +594,7 @@ class TestOCIRecipeAdminView(BaseTestOCIRecipeView):
594class TestOCIRecipeEditView(OCIConfigHelperMixin, BaseTestOCIRecipeView):594class TestOCIRecipeEditView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
595595
596 def setUp(self):596 def setUp(self):
597 super(TestOCIRecipeEditView, self).setUp()597 super().setUp()
598 self.distroseries = self.factory.makeDistroSeries()598 self.distroseries = self.factory.makeDistroSeries()
599 self.distribution = self.distroseries.distribution599 self.distribution = self.distroseries.distribution
600 self.useFixture(FeatureFixture({600 self.useFixture(FeatureFixture({
@@ -1140,7 +1140,7 @@ class TestOCIRecipeEditView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
1140class TestOCIRecipeDeleteView(BaseTestOCIRecipeView):1140class TestOCIRecipeDeleteView(BaseTestOCIRecipeView):
11411141
1142 def setUp(self):1142 def setUp(self):
1143 super(TestOCIRecipeDeleteView, self).setUp()1143 super().setUp()
1144 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))1144 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
11451145
1146 def test_unauthorized(self):1146 def test_unauthorized(self):
@@ -1208,7 +1208,7 @@ class TestOCIRecipeDeleteView(BaseTestOCIRecipeView):
1208class TestOCIRecipeView(BaseTestOCIRecipeView):1208class TestOCIRecipeView(BaseTestOCIRecipeView):
12091209
1210 def setUp(self):1210 def setUp(self):
1211 super(TestOCIRecipeView, self).setUp()1211 super().setUp()
1212 self.distroseries = self.factory.makeDistroSeries()1212 self.distroseries = self.factory.makeDistroSeries()
1213 processor = getUtility(IProcessorSet).getByName("386")1213 processor = getUtility(IProcessorSet).getByName("386")
1214 self.distroarchseries = self.factory.makeDistroArchSeries(1214 self.distroarchseries = self.factory.makeDistroArchSeries(
@@ -1721,7 +1721,7 @@ class TestOCIRecipeView(BaseTestOCIRecipeView):
1721class TestOCIRecipeRequestBuildsView(BaseTestOCIRecipeView):1721class TestOCIRecipeRequestBuildsView(BaseTestOCIRecipeView):
17221722
1723 def setUp(self):1723 def setUp(self):
1724 super(TestOCIRecipeRequestBuildsView, self).setUp()1724 super().setUp()
1725 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu1725 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
1726 self.distroseries = self.factory.makeDistroSeries(1726 self.distroseries = self.factory.makeDistroSeries(
1727 distribution=self.ubuntu, name="shiny", displayname="Shiny")1727 distribution=self.ubuntu, name="shiny", displayname="Shiny")
@@ -1802,7 +1802,7 @@ class TestOCIRecipeRequestBuildsView(BaseTestOCIRecipeView):
1802class TestOCIRecipeEditPushRulesView(OCIConfigHelperMixin,1802class TestOCIRecipeEditPushRulesView(OCIConfigHelperMixin,
1803 BaseTestOCIRecipeView):1803 BaseTestOCIRecipeView):
1804 def setUp(self):1804 def setUp(self):
1805 super(TestOCIRecipeEditPushRulesView, self).setUp()1805 super().setUp()
1806 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu1806 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
1807 self.distroseries = self.factory.makeDistroSeries(1807 self.distroseries = self.factory.makeDistroSeries(
1808 distribution=self.ubuntu, name="shiny", displayname="Shiny")1808 distribution=self.ubuntu, name="shiny", displayname="Shiny")
@@ -2232,7 +2232,7 @@ class TestOCIRecipeEditPushRulesView(OCIConfigHelperMixin,
2232 self.assertEqual(len(rules), 1)2232 self.assertEqual(len(rules), 1)
2233 rule = rules[0]2233 rule = rules[0]
2234 self.assertThat(rule, MatchesStructure(2234 self.assertThat(rule, MatchesStructure(
2235 image_name=Equals(u'imagename1'),2235 image_name=Equals('imagename1'),
2236 registry_url=Equals(url),2236 registry_url=Equals(url),
2237 registry_credentials=MatchesStructure(2237 registry_credentials=MatchesStructure(
2238 url=Equals(url),2238 url=Equals(url),
@@ -2325,7 +2325,7 @@ class TestOCIRecipeEditPushRulesView(OCIConfigHelperMixin,
23252325
2326class TestOCIRecipeListingView(BaseTestOCIRecipeView):2326class TestOCIRecipeListingView(BaseTestOCIRecipeView):
2327 def setUp(self):2327 def setUp(self):
2328 super(TestOCIRecipeListingView, self).setUp()2328 super().setUp()
2329 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu2329 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
2330 self.distroseries = self.factory.makeDistroSeries(2330 self.distroseries = self.factory.makeDistroSeries(
2331 distribution=self.ubuntu, name="shiny", displayname="Shiny")2331 distribution=self.ubuntu, name="shiny", displayname="Shiny")
diff --git a/lib/lp/oci/browser/tests/test_ocirecipebuild.py b/lib/lp/oci/browser/tests/test_ocirecipebuild.py
index 7fa823e..2466f85 100644
--- a/lib/lp/oci/browser/tests/test_ocirecipebuild.py
+++ b/lib/lp/oci/browser/tests/test_ocirecipebuild.py
@@ -46,7 +46,7 @@ class TestCanonicalUrlForOCIRecipeBuild(TestCaseWithFactory):
46 layer = DatabaseFunctionalLayer46 layer = DatabaseFunctionalLayer
4747
48 def setUp(self):48 def setUp(self):
49 super(TestCanonicalUrlForOCIRecipeBuild, self).setUp()49 super().setUp()
50 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))50 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
5151
52 def test_canonical_url(self):52 def test_canonical_url(self):
@@ -70,7 +70,7 @@ class TestOCIRecipeBuildView(BrowserTestCase):
70 layer = LaunchpadFunctionalLayer70 layer = LaunchpadFunctionalLayer
7171
72 def setUp(self):72 def setUp(self):
73 super(TestOCIRecipeBuildView, self).setUp()73 super().setUp()
74 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))74 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
7575
76 def test_index(self):76 def test_index(self):
@@ -157,7 +157,7 @@ class TestOCIRecipeBuildOperations(BrowserTestCase):
157 layer = DatabaseFunctionalLayer157 layer = DatabaseFunctionalLayer
158158
159 def setUp(self):159 def setUp(self):
160 super(TestOCIRecipeBuildOperations, self).setUp()160 super().setUp()
161 self.useFixture(FakeLogger())161 self.useFixture(FakeLogger())
162 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))162 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
163 self.build = self.factory.makeOCIRecipeBuild()163 self.build = self.factory.makeOCIRecipeBuild()
diff --git a/lib/lp/oci/browser/tests/test_ocirecipesubscription.py b/lib/lp/oci/browser/tests/test_ocirecipesubscription.py
index 41b76b9..fbd60d6 100644
--- a/lib/lp/oci/browser/tests/test_ocirecipesubscription.py
+++ b/lib/lp/oci/browser/tests/test_ocirecipesubscription.py
@@ -29,7 +29,7 @@ class BaseTestOCIRecipeView(OCIConfigHelperMixin, BrowserTestCase):
29 layer = DatabaseFunctionalLayer29 layer = DatabaseFunctionalLayer
3030
31 def setUp(self):31 def setUp(self):
32 super(BaseTestOCIRecipeView, self).setUp()32 super().setUp()
33 self.setConfig()33 self.setConfig()
34 self.useFixture(FakeLogger())34 self.useFixture(FakeLogger())
35 self.person = self.factory.makePerson(name='recipe-owner')35 self.person = self.factory.makePerson(name='recipe-owner')
diff --git a/lib/lp/oci/interfaces/ocipushrule.py b/lib/lp/oci/interfaces/ocipushrule.py
index 5619875..9c800fa 100644
--- a/lib/lp/oci/interfaces/ocipushrule.py
+++ b/lib/lp/oci/interfaces/ocipushrule.py
@@ -40,7 +40,7 @@ class OCIPushRuleAlreadyExists(Exception):
40 """40 """
4141
42 def __init__(self):42 def __init__(self):
43 super(OCIPushRuleAlreadyExists, self).__init__(43 super().__init__(
44 "A push rule already exists with the same URL, image name, "44 "A push rule already exists with the same URL, image name, "
45 "and credentials")45 "and credentials")
4646
diff --git a/lib/lp/oci/interfaces/ocirecipe.py b/lib/lp/oci/interfaces/ocirecipe.py
index 47fffe7..2a7256c 100644
--- a/lib/lp/oci/interfaces/ocirecipe.py
+++ b/lib/lp/oci/interfaces/ocirecipe.py
@@ -94,7 +94,7 @@ class OCIRecipeFeatureDisabled(Unauthorized):
94 """Only certain users can create new OCI recipes."""94 """Only certain users can create new OCI recipes."""
9595
96 def __init__(self):96 def __init__(self):
97 super(OCIRecipeFeatureDisabled, self).__init__(97 super().__init__(
98 "You do not have permission to create new OCI recipes.")98 "You do not have permission to create new OCI recipes.")
9999
100100
@@ -108,7 +108,7 @@ class OCIRecipeBuildAlreadyPending(Exception):
108 """A build was requested when an identical build was already pending."""108 """A build was requested when an identical build was already pending."""
109109
110 def __init__(self):110 def __init__(self):
111 super(OCIRecipeBuildAlreadyPending, self).__init__(111 super().__init__(
112 "An identical build of this OCI recipe is already pending.")112 "An identical build of this OCI recipe is already pending.")
113113
114114
@@ -127,7 +127,7 @@ class UsingDistributionCredentials(Exception):
127 """The OCI Recipe is in a Distribution that has credentials set."""127 """The OCI Recipe is in a Distribution that has credentials set."""
128128
129 def __init__(self):129 def __init__(self):
130 super(UsingDistributionCredentials, self).__init__(130 super().__init__(
131 "The OCI recipe is in a distribution that has credentials set.")131 "The OCI recipe is in a distribution that has credentials set.")
132132
133133
@@ -136,7 +136,7 @@ class NoSourceForOCIRecipe(Exception):
136 """OCI Recipes must have a source and build file."""136 """OCI Recipes must have a source and build file."""
137137
138 def __init__(self):138 def __init__(self):
139 super(NoSourceForOCIRecipe, self).__init__(139 super().__init__(
140 "New OCI recipes must have a git branch and build file.")140 "New OCI recipes must have a git branch and build file.")
141141
142142
@@ -149,8 +149,7 @@ class CannotModifyOCIRecipeProcessor(Exception):
149 'by administrators.')149 'by administrators.')
150150
151 def __init__(self, processor):151 def __init__(self, processor):
152 super(CannotModifyOCIRecipeProcessor, self).__init__(152 super().__init__(self._fmt % {'processor': processor.name})
153 self._fmt % {'processor': processor.name})
154153
155154
156@error_status(http.client.BAD_REQUEST)155@error_status(http.client.BAD_REQUEST)
@@ -158,7 +157,7 @@ class OCIRecipePrivacyMismatch(Exception):
158 """OCI recipe privacy does not match its content."""157 """OCI recipe privacy does not match its content."""
159158
160 def __init__(self, message=None):159 def __init__(self, message=None):
161 super(OCIRecipePrivacyMismatch, self).__init__(160 super().__init__(
162 message or161 message or
163 "OCI recipe contains private information and cannot be public.")162 "OCI recipe contains private information and cannot be public.")
164163
@@ -168,7 +167,7 @@ class OCIRecipeBranchHasInvalidFormat(Exception):
168 """The branch name for the OCI recipe does not match the correct format."""167 """The branch name for the OCI recipe does not match the correct format."""
169168
170 def __init__(self):169 def __init__(self):
171 super(OCIRecipeBranchHasInvalidFormat, self).__init__(170 super().__init__(
172 "The branch name for the OCI recipe does not "171 "The branch name for the OCI recipe does not "
173 "match the APPVERSION-UBUNTUVERSION format (ex. v1.0-20.04)")172 "match the APPVERSION-UBUNTUVERSION format (ex. v1.0-20.04)")
174173
diff --git a/lib/lp/oci/interfaces/ociregistryclient.py b/lib/lp/oci/interfaces/ociregistryclient.py
index 323137d..e149a28 100644
--- a/lib/lp/oci/interfaces/ociregistryclient.py
+++ b/lib/lp/oci/interfaces/ociregistryclient.py
@@ -18,7 +18,7 @@ class OCIRegistryError(Exception):
18 """An error returned by an OCI registry."""18 """An error returned by an OCI registry."""
1919
20 def __init__(self, summary, errors):20 def __init__(self, summary, errors):
21 super(OCIRegistryError, self).__init__(summary)21 super().__init__(summary)
22 self.errors = errors22 self.errors = errors
2323
2424
diff --git a/lib/lp/oci/interfaces/ociregistrycredentials.py b/lib/lp/oci/interfaces/ociregistrycredentials.py
index 16af53e..a10400c 100644
--- a/lib/lp/oci/interfaces/ociregistrycredentials.py
+++ b/lib/lp/oci/interfaces/ociregistrycredentials.py
@@ -39,7 +39,7 @@ class OCIRegistryCredentialsAlreadyExist(Exception):
39 """39 """
4040
41 def __init__(self):41 def __init__(self):
42 super(OCIRegistryCredentialsAlreadyExist, self).__init__(42 super().__init__(
43 "Credentials already exist with the same URL, username, and "43 "Credentials already exist with the same URL, username, and "
44 "region.")44 "region.")
4545
diff --git a/lib/lp/oci/model/ocirecipe.py b/lib/lp/oci/model/ocirecipe.py
index 274092d..73edd1a 100644
--- a/lib/lp/oci/model/ocirecipe.py
+++ b/lib/lp/oci/model/ocirecipe.py
@@ -16,7 +16,6 @@ __all__ = [
1616
17from lazr.lifecycle.event import ObjectCreatedEvent17from lazr.lifecycle.event import ObjectCreatedEvent
18import pytz18import pytz
19import six
20from storm.databases.postgres import JSON19from storm.databases.postgres import JSON
21from storm.expr import (20from storm.expr import (
22 And,21 And,
@@ -246,7 +245,7 @@ class OCIRecipe(Storm, WebhookTargetMixin):
246 image_name=None, information_type=InformationType.PUBLIC):245 image_name=None, information_type=InformationType.PUBLIC):
247 if not getFeatureFlag(OCI_RECIPE_ALLOW_CREATE):246 if not getFeatureFlag(OCI_RECIPE_ALLOW_CREATE):
248 raise OCIRecipeFeatureDisabled()247 raise OCIRecipeFeatureDisabled()
249 super(OCIRecipe, self).__init__()248 super().__init__()
250 self._information_type = information_type249 self._information_type = information_type
251 self.oci_project = oci_project250 self.oci_project = oci_project
252 self.name = name251 self.name = name
@@ -311,8 +310,7 @@ class OCIRecipe(Storm, WebhookTargetMixin):
311 @build_args.setter310 @build_args.setter
312 def build_args(self, value):311 def build_args(self, value):
313 assert value is None or isinstance(value, dict)312 assert value is None or isinstance(value, dict)
314 self._build_args = {k: six.text_type(v)313 self._build_args = {k: str(v) for k, v in (value or {}).items()}
315 for k, v in (value or {}).items()}
316314
317 def _reconcileAccess(self):315 def _reconcileAccess(self):
318 """Reconcile the OCI recipe's sharing information.316 """Reconcile the OCI recipe's sharing information.
diff --git a/lib/lp/oci/model/ocirecipebuild.py b/lib/lp/oci/model/ocirecipebuild.py
index 0172697..fc4e3e2 100644
--- a/lib/lp/oci/model/ocirecipebuild.py
+++ b/lib/lp/oci/model/ocirecipebuild.py
@@ -104,7 +104,7 @@ class OCIFile(StormBase):
104104
105 def __init__(self, build, library_file, layer_file_digest=None):105 def __init__(self, build, library_file, layer_file_digest=None):
106 """Construct a `OCIFile`."""106 """Construct a `OCIFile`."""
107 super(OCIFile, self).__init__()107 super().__init__()
108 self.build = build108 self.build = build
109 self.library_file = library_file109 self.library_file = library_file
110 self.layer_file_digest = layer_file_digest110 self.layer_file_digest = layer_file_digest
@@ -409,7 +409,7 @@ class OCIRecipeBuild(PackageBuildMixin, StormBase):
409 """See `IBuildFarmJob`."""409 """See `IBuildFarmJob`."""
410 edited_fields = set()410 edited_fields = set()
411 with notify_modified(self, edited_fields) as previous_obj:411 with notify_modified(self, edited_fields) as previous_obj:
412 super(OCIRecipeBuild, self).updateStatus(412 super().updateStatus(
413 status, builder=builder, slave_status=slave_status,413 status, builder=builder, slave_status=slave_status,
414 date_started=date_started, date_finished=date_finished,414 date_started=date_started, date_finished=date_finished,
415 force_invalid_transition=force_invalid_transition)415 force_invalid_transition=force_invalid_transition)
diff --git a/lib/lp/oci/model/ocirecipebuildbehaviour.py b/lib/lp/oci/model/ocirecipebuildbehaviour.py
index 46c8569..0532204 100644
--- a/lib/lp/oci/model/ocirecipebuildbehaviour.py
+++ b/lib/lp/oci/model/ocirecipebuildbehaviour.py
@@ -126,8 +126,7 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase):
126 Return the extra arguments required by the slave for the given build.126 Return the extra arguments required by the slave for the given build.
127 """127 """
128 build = self.build128 build = self.build
129 args = yield super(OCIRecipeBuildBehaviour, self).extraBuildArgs(129 args = yield super().extraBuildArgs(logger=logger)
130 logger=logger)
131 yield self.addProxyArgs(args, build.recipe.allow_internet)130 yield self.addProxyArgs(args, build.recipe.allow_internet)
132 # XXX twom 2020-02-17 This may need to be more complex, and involve131 # XXX twom 2020-02-17 This may need to be more complex, and involve
133 # distribution name.132 # distribution name.
@@ -186,7 +185,7 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase):
186 self._ensureFilePath(name, file_path, upload_path)185 self._ensureFilePath(name, file_path, upload_path)
187 yield self._slave.getFile(file_hash, file_path)186 yield self._slave.getFile(file_hash, file_path)
188187
189 with open(file_path, 'r') as file_fp:188 with open(file_path) as file_fp:
190 return json.load(file_fp)189 return json.load(file_fp)
191190
192 def _extractLayerFiles(self, upload_path, section, config, digests, files):191 def _extractLayerFiles(self, upload_path, section, config, digests, files):
diff --git a/lib/lp/oci/model/ocirecipebuildjob.py b/lib/lp/oci/model/ocirecipebuildjob.py
index 1d3143b..4d7f098 100644
--- a/lib/lp/oci/model/ocirecipebuildjob.py
+++ b/lib/lp/oci/model/ocirecipebuildjob.py
@@ -95,7 +95,7 @@ class OCIRecipeBuildJob(StormBase):
95 :param json_data: The type-specific variables, as a JSON-compatible95 :param json_data: The type-specific variables, as a JSON-compatible
96 dict.96 dict.
97 """97 """
98 super(OCIRecipeBuildJob, self).__init__()98 super().__init__()
99 self.job = Job(**job_args)99 self.job = Job(**job_args)
100 self.build = build100 self.build = build
101 self.job_type = job_type101 self.job_type = job_type
@@ -156,7 +156,7 @@ class OCIRecipeBuildJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass):
156156
157 def getOopsVars(self):157 def getOopsVars(self):
158 """See `IRunnableJob`."""158 """See `IRunnableJob`."""
159 oops_vars = super(OCIRecipeBuildJobDerived, self).getOopsVars()159 oops_vars = super().getOopsVars()
160 oops_vars.extend([160 oops_vars.extend([
161 ('job_type', self.context.job_type.title),161 ('job_type', self.context.job_type.title),
162 ('build_id', self.context.build.id),162 ('build_id', self.context.build.id),
@@ -232,7 +232,7 @@ class OCIRegistryUploadJob(OCIRecipeBuildJobDerived):
232 *args, **kwargs):232 *args, **kwargs):
233 edited_fields = set()233 edited_fields = set()
234 with notify_modified(self.build, edited_fields) as before_modification:234 with notify_modified(self.build, edited_fields) as before_modification:
235 getattr(super(OCIRegistryUploadJob, self), method_name)(235 getattr(super(), method_name)(
236 *args, manage_transaction=manage_transaction, **kwargs)236 *args, manage_transaction=manage_transaction, **kwargs)
237 upload_status = self.build.registry_upload_status237 upload_status = self.build.registry_upload_status
238 if upload_status != before_modification.registry_upload_status:238 if upload_status != before_modification.registry_upload_status:
diff --git a/lib/lp/oci/model/ocirecipejob.py b/lib/lp/oci/model/ocirecipejob.py
index 33f3429..4ba7d5e 100644
--- a/lib/lp/oci/model/ocirecipejob.py
+++ b/lib/lp/oci/model/ocirecipejob.py
@@ -96,7 +96,7 @@ class OCIRecipeJob(StormBase):
96 :param metadata: The type-specific variables, as a JSON-compatible96 :param metadata: The type-specific variables, as a JSON-compatible
97 dict.97 dict.
98 """98 """
99 super(OCIRecipeJob, self).__init__()99 super().__init__()
100 self.job = Job(**job_args)100 self.job = Job(**job_args)
101 self.recipe = recipe101 self.recipe = recipe
102 self.job_type = job_type102 self.job_type = job_type
@@ -145,7 +145,7 @@ class OCIRecipeJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass):
145145
146 def getOopsVars(self):146 def getOopsVars(self):
147 """See `IRunnableJob`."""147 """See `IRunnableJob`."""
148 oops_vars = super(OCIRecipeJobDerived, self).getOopsVars()148 oops_vars = super().getOopsVars()
149 oops_vars.extend([149 oops_vars.extend([
150 ("job_id", self.context.job.id),150 ("job_id", self.context.job.id),
151 ("job_type", self.context.job_type.title),151 ("job_type", self.context.job_type.title),
diff --git a/lib/lp/oci/model/ocirecipesubscription.py b/lib/lp/oci/model/ocirecipesubscription.py
index 970c66c..4de765e 100644
--- a/lib/lp/oci/model/ocirecipesubscription.py
+++ b/lib/lp/oci/model/ocirecipesubscription.py
@@ -44,7 +44,7 @@ class OCIRecipeSubscription(StormBase):
44 subscribed_by = Reference(subscribed_by_id, "Person.id")44 subscribed_by = Reference(subscribed_by_id, "Person.id")
4545
46 def __init__(self, recipe, person, subscribed_by):46 def __init__(self, recipe, person, subscribed_by):
47 super(OCIRecipeSubscription, self).__init__()47 super().__init__()
48 self.recipe = recipe48 self.recipe = recipe
49 self.person = person49 self.person = person
50 self.subscribed_by = subscribed_by50 self.subscribed_by = subscribed_by
diff --git a/lib/lp/oci/model/ociregistryclient.py b/lib/lp/oci/model/ociregistryclient.py
index 198a4b2..30a99ad 100644
--- a/lib/lp/oci/model/ociregistryclient.py
+++ b/lib/lp/oci/model/ociregistryclient.py
@@ -617,7 +617,7 @@ class OCIRegistryClient:
617617
618class OCIRegistryAuthenticationError(Exception):618class OCIRegistryAuthenticationError(Exception):
619 def __init__(self, msg, http_error=None):619 def __init__(self, msg, http_error=None):
620 super(OCIRegistryAuthenticationError, self).__init__(msg)620 super().__init__(msg)
621 self.http_error = http_error621 self.http_error = http_error
622622
623623
@@ -696,7 +696,7 @@ class BearerTokenRegistryClient(RegistryHTTPClient):
696 """696 """
697697
698 def __init__(self, push_rule):698 def __init__(self, push_rule):
699 super(BearerTokenRegistryClient, self).__init__(push_rule)699 super().__init__(push_rule)
700 self.auth_token = None700 self.auth_token = None
701701
702 def parseAuthInstructions(self, request):702 def parseAuthInstructions(self, request):
@@ -721,7 +721,7 @@ class BearerTokenRegistryClient(RegistryHTTPClient):
721 "Auth instructions didn't include realm to get the token: %s"721 "Auth instructions didn't include realm to get the token: %s"
722 % values)722 % values)
723 # We should use the basic auth version for this request.723 # We should use the basic auth version for this request.
724 response = super(BearerTokenRegistryClient, self).request(724 response = super().request(
725 url, params=values, method="GET", auth=self.credentials)725 url, params=values, method="GET", auth=self.credentials)
726 response.raise_for_status()726 response.raise_for_status()
727 response_data = response.json()727 response_data = response.json()
diff --git a/lib/lp/oci/tests/helpers.py b/lib/lp/oci/tests/helpers.py
index c3b7b4b..336b078 100644
--- a/lib/lp/oci/tests/helpers.py
+++ b/lib/lp/oci/tests/helpers.py
@@ -49,7 +49,7 @@ class MatchesOCIRegistryCredentials(MatchesAll):
49 """49 """
5050
51 def __init__(self, main_matcher, credentials_matcher):51 def __init__(self, main_matcher, credentials_matcher):
52 super(MatchesOCIRegistryCredentials, self).__init__(52 super().__init__(
53 main_matcher,53 main_matcher,
54 AfterPreprocessing(54 AfterPreprocessing(
55 lambda matchee: removeSecurityProxy(matchee).getCredentials(),55 lambda matchee: removeSecurityProxy(matchee).getCredentials(),
diff --git a/lib/lp/oci/tests/test_ocipushrule.py b/lib/lp/oci/tests/test_ocipushrule.py
index 52fee49..043c6b9 100644
--- a/lib/lp/oci/tests/test_ocipushrule.py
+++ b/lib/lp/oci/tests/test_ocipushrule.py
@@ -27,7 +27,7 @@ class TestOCIPushRule(OCIConfigHelperMixin, TestCaseWithFactory):
27 layer = LaunchpadZopelessLayer27 layer = LaunchpadZopelessLayer
2828
29 def setUp(self):29 def setUp(self):
30 super(TestOCIPushRule, self).setUp()30 super().setUp()
31 self.setConfig()31 self.setConfig()
3232
33 def test_implements_interface(self):33 def test_implements_interface(self):
@@ -75,7 +75,7 @@ class TestOCIPushRuleSet(OCIConfigHelperMixin, TestCaseWithFactory):
75 layer = LaunchpadZopelessLayer75 layer = LaunchpadZopelessLayer
7676
77 def setUp(self):77 def setUp(self):
78 super(TestOCIPushRuleSet, self).setUp()78 super().setUp()
79 self.setConfig()79 self.setConfig()
8080
81 def test_implements_interface(self):81 def test_implements_interface(self):
diff --git a/lib/lp/oci/tests/test_ocirecipe.py b/lib/lp/oci/tests/test_ocirecipe.py
index 6bab89e..b3b4475 100644
--- a/lib/lp/oci/tests/test_ocirecipe.py
+++ b/lib/lp/oci/tests/test_ocirecipe.py
@@ -7,8 +7,6 @@ from datetime import datetime
7import json7import json
88
9from fixtures import FakeLogger9from fixtures import FakeLogger
10import six
11from six import string_types
12from storm.exceptions import LostObjectError10from storm.exceptions import LostObjectError
13from storm.store import Store11from storm.store import Store
14from testtools import ExpectedException12from testtools import ExpectedException
@@ -113,7 +111,7 @@ class TestOCIRecipe(OCIConfigHelperMixin, TestCaseWithFactory):
113 layer = DatabaseFunctionalLayer111 layer = DatabaseFunctionalLayer
114112
115 def setUp(self):113 def setUp(self):
116 super(TestOCIRecipe, self).setUp()114 super().setUp()
117 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))115 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
118116
119 def test_implements_interface(self):117 def test_implements_interface(self):
@@ -759,7 +757,7 @@ class TestOCIRecipe(OCIConfigHelperMixin, TestCaseWithFactory):
759 # It should be sorted by owner's name first, then recipe name.757 # It should be sorted by owner's name first, then recipe name.
760 self.assertEqual(758 self.assertEqual(
761 [recipe3, recipe1, recipe2],759 [recipe3, recipe1, recipe2],
762 list(oci_project.searchRecipes(u"a")))760 list(oci_project.searchRecipes("a")))
763761
764 def test_build_args_dict(self):762 def test_build_args_dict(self):
765 args = {"MY_VERSION": "1.0.3", "ANOTHER_VERSION": "2.9.88"}763 args = {"MY_VERSION": "1.0.3", "ANOTHER_VERSION": "2.9.88"}
@@ -784,7 +782,7 @@ class TestOCIRecipe(OCIConfigHelperMixin, TestCaseWithFactory):
784 # Makes sure we only store one level of key=pair, flattening to782 # Makes sure we only store one level of key=pair, flattening to
785 # string every value.783 # string every value.
786 args = {784 args = {
787 "VAR1": {six.ensure_str("something"): [1, 2, 3]},785 "VAR1": {"something": [1, 2, 3]},
788 "VAR2": 123,786 "VAR2": 123,
789 "VAR3": "A string",787 "VAR3": "A string",
790 }788 }
@@ -873,7 +871,7 @@ class TestOCIRecipeAccessControl(TestCaseWithFactory, OCIConfigHelperMixin):
873 layer = DatabaseFunctionalLayer871 layer = DatabaseFunctionalLayer
874872
875 def setUp(self):873 def setUp(self):
876 super(TestOCIRecipeAccessControl, self).setUp()874 super().setUp()
877 self.setConfig()875 self.setConfig()
878876
879 def test_change_oci_project_pillar_reconciles_access(self):877 def test_change_oci_project_pillar_reconciles_access(self):
@@ -1042,8 +1040,7 @@ class TestOCIRecipeProcessors(TestCaseWithFactory):
1042 layer = DatabaseFunctionalLayer1040 layer = DatabaseFunctionalLayer
10431041
1044 def setUp(self):1042 def setUp(self):
1045 super(TestOCIRecipeProcessors, self).setUp(1043 super().setUp(user="foo.bar@canonical.com")
1046 user="foo.bar@canonical.com")
1047 self.default_procs = [1044 self.default_procs = [
1048 getUtility(IProcessorSet).getByName("386"),1045 getUtility(IProcessorSet).getByName("386"),
1049 getUtility(IProcessorSet).getByName("amd64")]1046 getUtility(IProcessorSet).getByName("amd64")]
@@ -1192,7 +1189,7 @@ class TestOCIRecipeSet(TestCaseWithFactory):
1192 layer = DatabaseFunctionalLayer1189 layer = DatabaseFunctionalLayer
11931190
1194 def setUp(self):1191 def setUp(self):
1195 super(TestOCIRecipeSet, self).setUp()1192 super().setUp()
1196 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))1193 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
11971194
1198 def test_implements_interface(self):1195 def test_implements_interface(self):
@@ -1373,7 +1370,7 @@ class TestOCIRecipeWebservice(OCIConfigHelperMixin, TestCaseWithFactory):
1373 layer = DatabaseFunctionalLayer1370 layer = DatabaseFunctionalLayer
13741371
1375 def setUp(self):1372 def setUp(self):
1376 super(TestOCIRecipeWebservice, self).setUp()1373 super().setUp()
1377 self.person = self.factory.makePerson(1374 self.person = self.factory.makePerson(
1378 displayname="Test Person")1375 displayname="Test Person")
1379 self.webservice = webservice_for_person(1376 self.webservice = webservice_for_person(
@@ -1384,7 +1381,7 @@ class TestOCIRecipeWebservice(OCIConfigHelperMixin, TestCaseWithFactory):
1384 def getAbsoluteURL(self, target):1381 def getAbsoluteURL(self, target):
1385 """Get the webservice absolute URL of the given object or relative1382 """Get the webservice absolute URL of the given object or relative
1386 path."""1383 path."""
1387 if not isinstance(target, string_types):1384 if not isinstance(target, str):
1388 target = api_url(target)1385 target = api_url(target)
1389 return self.webservice.getAbsoluteUrl(target)1386 return self.webservice.getAbsoluteUrl(target)
13901387
@@ -1688,7 +1685,7 @@ class TestOCIRecipeAsyncWebservice(TestCaseWithFactory):
1688 layer = LaunchpadFunctionalLayer1685 layer = LaunchpadFunctionalLayer
16891686
1690 def setUp(self):1687 def setUp(self):
1691 super(TestOCIRecipeAsyncWebservice, self).setUp()1688 super().setUp()
1692 self.person = self.factory.makePerson(1689 self.person = self.factory.makePerson(
1693 displayname="Test Person")1690 displayname="Test Person")
1694 self.webservice = webservice_for_person(1691 self.webservice = webservice_for_person(
@@ -1764,8 +1761,8 @@ class TestOCIRecipeAsyncWebservice(TestCaseWithFactory):
1764 "recipe_link": Equals(abs_url(oci_recipe)),1761 "recipe_link": Equals(abs_url(oci_recipe)),
1765 "requester_link": Equals(abs_url(self.person)),1762 "requester_link": Equals(abs_url(self.person)),
1766 "buildstate": Equals("Needs building"),1763 "buildstate": Equals("Needs building"),
1767 "eta": IsInstance(string_types, type(None)),1764 "eta": IsInstance(str, type(None)),
1768 "date": IsInstance(string_types, type(None)),1765 "date": IsInstance(str, type(None)),
1769 "estimate": IsInstance(bool),1766 "estimate": IsInstance(bool),
1770 "distro_arch_series_link": Equals(abs_url(arch_series)),1767 "distro_arch_series_link": Equals(abs_url(arch_series)),
1771 "registry_upload_status": Equals("Unscheduled"),1768 "registry_upload_status": Equals("Unscheduled"),
diff --git a/lib/lp/oci/tests/test_ocirecipebuild.py b/lib/lp/oci/tests/test_ocirecipebuild.py
index c86169e..1ec8718 100644
--- a/lib/lp/oci/tests/test_ocirecipebuild.py
+++ b/lib/lp/oci/tests/test_ocirecipebuild.py
@@ -11,7 +11,6 @@ from datetime import (
11from fixtures import FakeLogger11from fixtures import FakeLogger
12from pymacaroons import Macaroon12from pymacaroons import Macaroon
13import pytz13import pytz
14import six
15from six.moves.urllib.request import urlopen14from six.moves.urllib.request import urlopen
16from testtools.matchers import (15from testtools.matchers import (
17 ContainsDict,16 ContainsDict,
@@ -93,7 +92,7 @@ class TestOCIFileSet(TestCaseWithFactory):
93 layer = LaunchpadZopelessLayer92 layer = LaunchpadZopelessLayer
9493
95 def setUp(self):94 def setUp(self):
96 super(TestOCIFileSet, self).setUp()95 super().setUp()
97 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))96 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
9897
99 def test_implements_interface(self):98 def test_implements_interface(self):
@@ -119,7 +118,7 @@ class TestOCIRecipeBuild(OCIConfigHelperMixin, TestCaseWithFactory):
119 layer = LaunchpadZopelessLayer118 layer = LaunchpadZopelessLayer
120119
121 def setUp(self):120 def setUp(self):
122 super(TestOCIRecipeBuild, self).setUp()121 super().setUp()
123 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))122 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
124 self.build = self.factory.makeOCIRecipeBuild()123 self.build = self.factory.makeOCIRecipeBuild()
125124
@@ -160,7 +159,7 @@ class TestOCIRecipeBuild(OCIConfigHelperMixin, TestCaseWithFactory):
160159
161 def test_getLayerFileByDigest(self):160 def test_getLayerFileByDigest(self):
162 files = [self.factory.makeOCIFile(161 files = [self.factory.makeOCIFile(
163 build=self.build, layer_file_digest=six.text_type(x))162 build=self.build, layer_file_digest=str(x))
164 for x in range(3)]163 for x in range(3)]
165 result, _, _ = self.build.getLayerFileByDigest(164 result, _, _ = self.build.getLayerFileByDigest(
166 files[0].layer_file_digest)165 files[0].layer_file_digest)
@@ -168,7 +167,7 @@ class TestOCIRecipeBuild(OCIConfigHelperMixin, TestCaseWithFactory):
168167
169 def test_getLayerFileByDigest_missing(self):168 def test_getLayerFileByDigest_missing(self):
170 [self.factory.makeOCIFile(169 [self.factory.makeOCIFile(
171 build=self.build, layer_file_digest=six.text_type(x))170 build=self.build, layer_file_digest=str(x))
172 for x in range(3)]171 for x in range(3)]
173 self.assertRaises(172 self.assertRaises(
174 NotFoundError,173 NotFoundError,
@@ -609,7 +608,7 @@ class TestOCIRecipeBuildSet(TestCaseWithFactory):
609 layer = DatabaseFunctionalLayer608 layer = DatabaseFunctionalLayer
610609
611 def setUp(self):610 def setUp(self):
612 super(TestOCIRecipeBuildSet, self).setUp()611 super().setUp()
613 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))612 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
614613
615 def test_implements_interface(self):614 def test_implements_interface(self):
@@ -707,7 +706,7 @@ class TestOCIRecipeBuildWebservice(OCIConfigHelperMixin, TestCaseWithFactory):
707 layer = LaunchpadFunctionalLayer706 layer = LaunchpadFunctionalLayer
708707
709 def setUp(self):708 def setUp(self):
710 super(TestOCIRecipeBuildWebservice, self).setUp()709 super().setUp()
711 self.setConfig()710 self.setConfig()
712 self.person = self.factory.makePerson()711 self.person = self.factory.makePerson()
713 self.webservice = webservice_for_person(712 self.webservice = webservice_for_person(
@@ -855,7 +854,7 @@ class TestOCIRecipeBuildMacaroonIssuer(
855 layer = LaunchpadZopelessLayer854 layer = LaunchpadZopelessLayer
856855
857 def setUp(self):856 def setUp(self):
858 super(TestOCIRecipeBuildMacaroonIssuer, self).setUp()857 super().setUp()
859 self.setConfig()858 self.setConfig()
860 self.pushConfig(859 self.pushConfig(
861 "launchpad", internal_macaroon_secret_key="some-secret")860 "launchpad", internal_macaroon_secret_key="some-secret")
diff --git a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
index 5109dfe..0961a2b 100644
--- a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
+++ b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
@@ -140,7 +140,7 @@ class TestOCIBuildBehaviour(TestCaseWithFactory):
140 layer = LaunchpadZopelessLayer140 layer = LaunchpadZopelessLayer
141141
142 def setUp(self):142 def setUp(self):
143 super(TestOCIBuildBehaviour, self).setUp()143 super().setUp()
144 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))144 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
145145
146 def test_provides_interface(self):146 def test_provides_interface(self):
@@ -164,7 +164,7 @@ class TestAsyncOCIRecipeBuildBehaviour(
164164
165 @defer.inlineCallbacks165 @defer.inlineCallbacks
166 def setUp(self):166 def setUp(self):
167 super(TestAsyncOCIRecipeBuildBehaviour, self).setUp()167 super().setUp()
168 build_username = 'OCIBUILD-1'168 build_username = 'OCIBUILD-1'
169 self.token = {'secret': uuid.uuid4().hex,169 self.token = {'secret': uuid.uuid4().hex,
170 'username': build_username,170 'username': build_username,
@@ -696,7 +696,7 @@ class TestHandleStatusForOCIRecipeBuild(MakeOCIBuildMixin,
696 self.slave.valid_files[hash] = path696 self.slave.valid_files[hash] = path
697697
698 def setUp(self):698 def setUp(self):
699 super(TestHandleStatusForOCIRecipeBuild, self).setUp()699 super().setUp()
700 self.useFixture(fixtures.FakeLogger())700 self.useFixture(fixtures.FakeLogger())
701 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))701 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
702 self.build = self.makeBuild()702 self.build = self.makeBuild()
@@ -766,7 +766,7 @@ class TestHandleStatusForOCIRecipeBuild(MakeOCIBuildMixin,
766 'layer_2.tar.gz': 'layer_2_hash'766 'layer_2.tar.gz': 'layer_2_hash'
767 }767 }
768 self.factory.makeOCIFile(768 self.factory.makeOCIFile(
769 build=self.build, layer_file_digest=u'digest_1',769 build=self.build, layer_file_digest='digest_1',
770 content=b"retrieved from librarian")770 content=b"retrieved from librarian")
771771
772 def assertResultCount(self, count, result):772 def assertResultCount(self, count, result):
@@ -809,7 +809,7 @@ class TestHandleStatusForOCIRecipeBuild(MakeOCIBuildMixin,
809 def test_handleStatus_OK_reuse_from_other_build(self):809 def test_handleStatus_OK_reuse_from_other_build(self):
810 """We should be able to reuse a layer file from a separate build."""810 """We should be able to reuse a layer file from a separate build."""
811 oci_file = self.factory.makeOCIFile(811 oci_file = self.factory.makeOCIFile(
812 layer_file_digest=u'digest_2',812 layer_file_digest='digest_2',
813 content=b"layer 2 retrieved from librarian")813 content=b"layer 2 retrieved from librarian")
814814
815 now = datetime.now(pytz.UTC)815 now = datetime.now(pytz.UTC)
@@ -971,4 +971,4 @@ class TestGetUploadMethodsForOCIRecipeBuild(
971 """IPackageBuild.getUpload-related methods work with OCI recipe builds."""971 """IPackageBuild.getUpload-related methods work with OCI recipe builds."""
972 def setUp(self):972 def setUp(self):
973 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))973 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
974 super(TestGetUploadMethodsForOCIRecipeBuild, self).setUp()974 super().setUp()
diff --git a/lib/lp/oci/tests/test_ocirecipebuildjob.py b/lib/lp/oci/tests/test_ocirecipebuildjob.py
index 742b3ec..2bece4a 100644
--- a/lib/lp/oci/tests/test_ocirecipebuildjob.py
+++ b/lib/lp/oci/tests/test_ocirecipebuildjob.py
@@ -99,7 +99,7 @@ class TestOCIRecipeBuildJob(TestCaseWithFactory):
99 layer = DatabaseFunctionalLayer99 layer = DatabaseFunctionalLayer
100100
101 def setUp(self):101 def setUp(self):
102 super(TestOCIRecipeBuildJob, self).setUp()102 super().setUp()
103 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))103 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
104104
105 def test_provides_interface(self):105 def test_provides_interface(self):
@@ -130,7 +130,7 @@ class TestOCIRecipeBuildJobDerived(TestCaseWithFactory):
130 layer = DatabaseFunctionalLayer130 layer = DatabaseFunctionalLayer
131131
132 def setUp(self):132 def setUp(self):
133 super(TestOCIRecipeBuildJobDerived, self).setUp()133 super().setUp()
134 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))134 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
135135
136 def test_repr(self):136 def test_repr(self):
@@ -151,8 +151,7 @@ class TestOCIRecipeBuildJobDerived(TestCaseWithFactory):
151 def __getattribute__(self, item):151 def __getattribute__(self, item):
152 if item == 'build':152 if item == 'build':
153 raise AttributeError("Somethng is wrong with build")153 raise AttributeError("Somethng is wrong with build")
154 return super(154 return super().__getattribute__(item)
155 ErrorOCIRecipeBuildJobDerived, self).__getattribute__(item)
156 oci_build = self.factory.makeOCIRecipeBuild()155 oci_build = self.factory.makeOCIRecipeBuild()
157 job = OCIRecipeBuildJob(156 job = OCIRecipeBuildJob(
158 oci_build, OCIRecipeBuildJobType.REGISTRY_UPLOAD, {})157 oci_build, OCIRecipeBuildJobType.REGISTRY_UPLOAD, {})
@@ -204,7 +203,7 @@ class TestOCIRegistryUploadJob(TestCaseWithFactory, MultiArchRecipeMixin,
204 layer = LaunchpadZopelessLayer203 layer = LaunchpadZopelessLayer
205204
206 def setUp(self):205 def setUp(self):
207 super(TestOCIRegistryUploadJob, self).setUp()206 super().setUp()
208 self.useFixture(FeatureFixture({207 self.useFixture(FeatureFixture({
209 'webhooks.new.enabled': 'true',208 'webhooks.new.enabled': 'true',
210 OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: 'on',209 OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: 'on',
@@ -556,7 +555,7 @@ class TestOCIRegistryUploadJobViaCelery(TestCaseWithFactory,
556 layer = CelerySlowJobLayer555 layer = CelerySlowJobLayer
557556
558 def setUp(self):557 def setUp(self):
559 super(TestOCIRegistryUploadJobViaCelery, self).setUp()558 super().setUp()
560 self.useFixture(FeatureFixture({559 self.useFixture(FeatureFixture({
561 'webhooks.new.enabled': 'true',560 'webhooks.new.enabled': 'true',
562 OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: 'on',561 OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: 'on',
diff --git a/lib/lp/oci/tests/test_ocirecipejob.py b/lib/lp/oci/tests/test_ocirecipejob.py
index 2a37120..ef0400f 100644
--- a/lib/lp/oci/tests/test_ocirecipejob.py
+++ b/lib/lp/oci/tests/test_ocirecipejob.py
@@ -29,7 +29,7 @@ class TestOCIRecipeRequestBuildsJob(TestCaseWithFactory):
29 layer = DatabaseFunctionalLayer29 layer = DatabaseFunctionalLayer
3030
31 def setUp(self):31 def setUp(self):
32 super(TestOCIRecipeRequestBuildsJob, self).setUp()32 super().setUp()
33 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))33 self.useFixture(FeatureFixture({OCI_RECIPE_ALLOW_CREATE: 'on'}))
3434
35 def getDistroArchSeries(self, distroseries, proc_name="386",35 def getDistroArchSeries(self, distroseries, proc_name="386",
diff --git a/lib/lp/oci/tests/test_ociregistryclient.py b/lib/lp/oci/tests/test_ociregistryclient.py
index b6e84fc..22e8cfa 100644
--- a/lib/lp/oci/tests/test_ociregistryclient.py
+++ b/lib/lp/oci/tests/test_ociregistryclient.py
@@ -99,7 +99,7 @@ class TestOCIRegistryClient(OCIConfigHelperMixin, SpyProxyCallsMixin,
99 retry_count = 099 retry_count = 0
100100
101 def setUp(self):101 def setUp(self):
102 super(TestOCIRegistryClient, self).setUp()102 super().setUp()
103 self.setConfig()103 self.setConfig()
104 self.setupProxySpy()104 self.setupProxySpy()
105 self.manifest = [{105 self.manifest = [{
@@ -1174,7 +1174,7 @@ class TestRegistryHTTPClient(OCIConfigHelperMixin, SpyProxyCallsMixin,
1174 layer = DatabaseFunctionalLayer1174 layer = DatabaseFunctionalLayer
11751175
1176 def setUp(self):1176 def setUp(self):
1177 super(TestRegistryHTTPClient, self).setUp()1177 super().setUp()
1178 self.setConfig()1178 self.setConfig()
1179 self.setupProxySpy()1179 self.setupProxySpy()
11801180
@@ -1314,8 +1314,8 @@ class TestRegistryHTTPClient(OCIConfigHelperMixin, SpyProxyCallsMixin,
1314 boto.client.call_args)1314 boto.client.call_args)
1315 config = boto.client.call_args[-1]['config']1315 config = boto.client.call_args[-1]['config']
1316 self.assertEqual({1316 self.assertEqual({
1317 u'http': u'http://proxy.example.com:123',1317 'http': 'http://proxy.example.com:123',
1318 u'https': u'http://proxy.example.com:123'}, config.proxies)1318 'https': 'http://proxy.example.com:123'}, config.proxies)
13191319
1320 @responses.activate1320 @responses.activate
1321 def test_aws_malformed_url_region(self):1321 def test_aws_malformed_url_region(self):
@@ -1336,7 +1336,7 @@ class TestBearerTokenRegistryClient(OCIConfigHelperMixin,
1336 layer = DatabaseFunctionalLayer1336 layer = DatabaseFunctionalLayer
13371337
1338 def setUp(self):1338 def setUp(self):
1339 super(TestBearerTokenRegistryClient, self).setUp()1339 super().setUp()
1340 self.setConfig()1340 self.setConfig()
1341 self.setupProxySpy()1341 self.setupProxySpy()
13421342
@@ -1510,7 +1510,7 @@ class TestAWSAuthenticator(OCIConfigHelperMixin, TestCaseWithFactory):
1510 layer = DatabaseFunctionalLayer1510 layer = DatabaseFunctionalLayer
15111511
1512 def setUp(self):1512 def setUp(self):
1513 super(TestAWSAuthenticator, self).setUp()1513 super().setUp()
1514 self.setConfig()1514 self.setConfig()
15151515
1516 def test_get_region_from_credential(self):1516 def test_get_region_from_credential(self):
diff --git a/lib/lp/oci/tests/test_ociregistrycredentials.py b/lib/lp/oci/tests/test_ociregistrycredentials.py
index 1680091..66f51af 100644
--- a/lib/lp/oci/tests/test_ociregistrycredentials.py
+++ b/lib/lp/oci/tests/test_ociregistrycredentials.py
@@ -35,7 +35,7 @@ class TestOCIRegistryCredentials(OCIConfigHelperMixin, TestCaseWithFactory):
35 layer = LaunchpadZopelessLayer35 layer = LaunchpadZopelessLayer
3636
37 def setUp(self):37 def setUp(self):
38 super(TestOCIRegistryCredentials, self).setUp()38 super().setUp()
39 self.setConfig()39 self.setConfig()
4040
41 def test_implements_interface(self):41 def test_implements_interface(self):
@@ -139,7 +139,7 @@ class TestOCIRegistryCredentialsSet(OCIConfigHelperMixin, TestCaseWithFactory):
139 layer = LaunchpadZopelessLayer139 layer = LaunchpadZopelessLayer
140140
141 def setUp(self):141 def setUp(self):
142 super(TestOCIRegistryCredentialsSet, self).setUp()142 super().setUp()
143 self.setConfig()143 self.setConfig()
144144
145 def test_implements_interface(self):145 def test_implements_interface(self):

Subscribers

People subscribed via source and target branches

to status/vote changes: