launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #26115
[Merge] ~cjwatson/launchpad:py3-doctest-set-repr into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-doctest-set-repr into launchpad:master.
Commit message:
Adjust doctests for repr of sets in Python 3
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/396934
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-doctest-set-repr into launchpad:master.
diff --git a/lib/lp/answers/doc/faq-vocabulary.txt b/lib/lp/answers/doc/faq-vocabulary.txt
index 968f320..933eb19 100644
--- a/lib/lp/answers/doc/faq-vocabulary.txt
+++ b/lib/lp/answers/doc/faq-vocabulary.txt
@@ -24,8 +24,8 @@ collections:
>>> firefox_faqs = set(firefox.searchFAQs())
>>> vocabulary_faqs = set(term.value for term in vocabulary)
- >>> firefox_faqs.symmetric_difference(vocabulary_faqs)
- set([])
+ >>> for item in firefox_faqs.symmetric_difference(vocabulary_faqs):
+ ... print(item)
And it only contains FAQs:
diff --git a/lib/lp/app/widgets/doc/checkbox-matrix-widget.txt b/lib/lp/app/widgets/doc/checkbox-matrix-widget.txt
index a2dbd20..ad6cf7f 100644
--- a/lib/lp/app/widgets/doc/checkbox-matrix-widget.txt
+++ b/lib/lp/app/widgets/doc/checkbox-matrix-widget.txt
@@ -33,10 +33,14 @@ as a set from _getFormValue() or getInputValue():
>>> request = LaunchpadTestRequest(
... form={'field.licenses': ['GNU_LGPL_V2_1', 'GNU_GPL_V2']})
>>> matrix_widget = CheckBoxMatrixWidget(licenses_field, vtype, request)
- >>> matrix_widget._getFormValue()
- set([<...License.GNU_GPL_V2...>, <...License.GNU_LGPL_V2_1...>])
- >>> matrix_widget.getInputValue()
- set([<...License.GNU_GPL_V2...>, <...License.GNU_LGPL_V2_1...>])
+ >>> for item in sorted(matrix_widget._getFormValue()):
+ ... print(repr(item))
+ <...License.GNU_GPL_V2...>
+ <...License.GNU_LGPL_V2_1...>
+ >>> for item in sorted(matrix_widget.getInputValue()):
+ ... print(repr(item))
+ <...License.GNU_GPL_V2...>
+ <...License.GNU_LGPL_V2_1...>
It should render as many rows as are specified by the column_count attribute.
diff --git a/lib/lp/archiveuploader/tests/nascentuploadfile.txt b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
index 3bb1a25..a8e53af 100644
--- a/lib/lp/archiveuploader/tests/nascentuploadfile.txt
+++ b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
@@ -95,8 +95,9 @@ At this point the changesfile content is already parsed:
>>> ed_binary_changes.version
'0.2-20'
- >>> ed_binary_changes.architectures
- set(['i386'])
+ >>> for item in ed_binary_changes.architectures:
+ ... print(item)
+ i386
>>> ed_binary_changes.suite_name
'unstable'
diff --git a/lib/lp/bugs/doc/bug-tags.txt b/lib/lp/bugs/doc/bug-tags.txt
index 8448b71..366d1cd 100644
--- a/lib/lp/bugs/doc/bug-tags.txt
+++ b/lib/lp/bugs/doc/bug-tags.txt
@@ -201,15 +201,18 @@ _tagsToFieldValue() converts the tags entered in the form into a value
suitable for the field. In the absense of tags it returns an empty
frozenset():
- >>> tags_frozen_set_widget._tagsToFieldValue(None)
- frozenset([])
- >>> tags_frozen_set_widget._tagsToFieldValue([])
- frozenset([])
+ >>> for item in tags_frozen_set_widget._tagsToFieldValue(None):
+ ... print(item)
+ >>> for item in tags_frozen_set_widget._tagsToFieldValue([]):
+ ... print(item)
Otherwise it returns a `frozenset` of the tags given:
- >>> tags_frozen_set_widget._tagsToFieldValue([u"foo", u"bar"])
- frozenset([u'foo', u'bar'])
+ >>> for item in sorted(tags_frozen_set_widget._tagsToFieldValue(
+ ... [u"foo", u"bar"])):
+ ... print(item)
+ bar
+ foo
Large and Small Bug Tags Widget
diff --git a/lib/lp/bugs/doc/product-update-remote-product.txt b/lib/lp/bugs/doc/product-update-remote-product.txt
index 096375a..4491245 100644
--- a/lib/lp/bugs/doc/product-update-remote-product.txt
+++ b/lib/lp/bugs/doc/product-update-remote-product.txt
@@ -82,9 +82,9 @@ it's skipped as well.
>>> updater = TrackerTypeCollectingUpdater()
>>> updater.update()
- >>> multi_product_trackers.symmetric_difference(
- ... updater.looped_over_bug_tracker_types)
- set([])
+ >>> for item in multi_product_trackers.symmetric_difference(
+ ... updater.looped_over_bug_tracker_types):
+ ... print(item)
updateByBugTrackerType()
diff --git a/lib/lp/registry/browser/tests/milestone-views.txt b/lib/lp/registry/browser/tests/milestone-views.txt
index 6747dda..5e92fde 100644
--- a/lib/lp/registry/browser/tests/milestone-views.txt
+++ b/lib/lp/registry/browser/tests/milestone-views.txt
@@ -216,8 +216,9 @@ release as a set.
>>> ignored = login_person(person)
>>> view = create_view(milestone, '+index')
- >>> view.getReleases()
- set([<ProductRelease ...>])
+ >>> for release in view.getReleases():
+ ... print(repr(release))
+ <ProductRelease ...>
>>> [release.version for release in view.getReleases()]
[u'kakapo']
diff --git a/lib/lp/registry/doc/person.txt b/lib/lp/registry/doc/person.txt
index 11abc90..51e83da 100644
--- a/lib/lp/registry/doc/person.txt
+++ b/lib/lp/registry/doc/person.txt
@@ -642,8 +642,9 @@ team will go to that address.
u'support@xxxxxxxxxx'
>>> from lp.services.mail.helpers import get_contact_email_addresses
- >>> get_contact_email_addresses(ubuntu_team)
- set(['support@xxxxxxxxxx'])
+ >>> for email in get_contact_email_addresses(ubuntu_team):
+ ... print(email)
+ support@xxxxxxxxxx
On the other hand, if a team doesn't have a contact email address, all
notifications we send to the team will go to the preferred email of each
diff --git a/lib/lp/registry/doc/product-widgets.txt b/lib/lp/registry/doc/product-widgets.txt
index dd2e6c5..e08d8d8 100644
--- a/lib/lp/registry/doc/product-widgets.txt
+++ b/lib/lp/registry/doc/product-widgets.txt
@@ -327,8 +327,9 @@ One licence, the GNU GPL v2, is selected.
... else:
... print
- >>> license_widget.getInputValue()
- set([<DBItem License.GNU_GPL_V2, (130) ...>])
+ >>> for item in license_widget.getInputValue():
+ ... print(repr(item))
+ <DBItem License.GNU_GPL_V2, (130) ...>
>>> print_checked_items(license_widget())
[ ] Apache Licence ...
diff --git a/lib/lp/services/mail/tests/incomingmail.txt b/lib/lp/services/mail/tests/incomingmail.txt
index 3982bb1..f9fb29f 100644
--- a/lib/lp/services/mail/tests/incomingmail.txt
+++ b/lib/lp/services/mail/tests/incomingmail.txt
@@ -108,10 +108,10 @@ header is missing.)
Now we can see that each handler handled the emails sent to its domain:
- >>> set(foo_handler.handledMails) ^ set(msgids['foo.com'])
- set([])
- >>> set(bar_handler.handledMails) ^ set(msgids['bar.com'])
- set([])
+ >>> for item in set(foo_handler.handledMails) ^ set(msgids['foo.com']):
+ ... print(item)
+ >>> for item in set(bar_handler.handledMails) ^ set(msgids['bar.com']):
+ ... print(item)
--------------
Unhandled Mail
diff --git a/lib/lp/soyuz/doc/gina.txt b/lib/lp/soyuz/doc/gina.txt
index 7c60af4..0377498 100644
--- a/lib/lp/soyuz/doc/gina.txt
+++ b/lib/lp/soyuz/doc/gina.txt
@@ -668,17 +668,23 @@ There will now be a number of publishings in the partner archive:
All the publishings will also have the 'partner' component and the
partner archive:
- >>> print(set(sspph.component.name for sspph in source_difference))
- set([u'partner'])
+ >>> for name in set(sspph.component.name for sspph in source_difference):
+ ... print(name)
+ partner
- >>> print(set(sbpph.component.name for sbpph in binary_difference))
- set([u'partner'])
+ >>> for name in set(sbpph.component.name for sbpph in binary_difference):
+ ... print(name)
+ partner
- >>> print(set(sspph.archive.purpose.name for sspph in source_difference))
- set(['PARTNER'])
+ >>> for name in set(
+ ... sspph.archive.purpose.name for sspph in source_difference):
+ ... print(name)
+ PARTNER
- >>> print(set(sbpph.archive.purpose.name for sbpph in binary_difference))
- set(['PARTNER'])
+ >>> for name in set(
+ ... sbpph.archive.purpose.name for sbpph in binary_difference):
+ ... print(name)
+ PARTNER
Source-only imports
@@ -754,8 +760,9 @@ targetted distroseries, 'lenny'.
>>> lenny_sources.count()
12
- >>> print(set([pub.status.name for pub in lenny_sources]))
- set(['PUBLISHED'])
+ >>> for name in set([pub.status.name for pub in lenny_sources]):
+ ... print(name)
+ PUBLISHED
As mentioned before, lenny/i386 is empty, no binaries were imported.
Also, the number of binaries published in the whole debian distribution
diff --git a/lib/lp/soyuz/doc/sourcepackagerelease.txt b/lib/lp/soyuz/doc/sourcepackagerelease.txt
index 8bf8a31..4dc4558 100644
--- a/lib/lp/soyuz/doc/sourcepackagerelease.txt
+++ b/lib/lp/soyuz/doc/sourcepackagerelease.txt
@@ -77,8 +77,9 @@ property only returns the non-PPA builds.
All the builds returned are for non-PPA archives:
- >>> set(build.archive.purpose.name for build in spr.builds)
- set(['PRIMARY'])
+ >>> for item in set(build.archive.purpose.name for build in spr.builds):
+ ... print(item)
+ PRIMARY
Check that the uploaded changesfile works: