Merge ~cjwatson/launchpad:py3-archivepublisher-archiveuploader-exception-modules into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: f4492a4d798069ad591111f0fd66108e3fe29be7
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-archivepublisher-archiveuploader-exception-modules
Merge into: launchpad:master
Diff against target: 276 lines (+46/-34)
6 files modified
lib/lp/archivepublisher/tests/archive-signing.txt (+2/-1)
lib/lp/archiveuploader/tests/nascentupload-announcements.txt (+2/-3)
lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt (+4/-6)
lib/lp/archiveuploader/tests/nascentupload.txt (+2/-3)
lib/lp/archiveuploader/tests/nascentuploadfile.txt (+4/-2)
lib/lp/archiveuploader/tests/upload-path-parsing.txt (+32/-19)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+397156@code.launchpad.net

Commit message

lp.archive{publisher,uploader}: Use IGNORE_EXCEPTION_MODULE_IN_PYTHON2

Description of the change

This allows doctests that test tracebacks to work on both Python 2 and 3.

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

Self-approving, since this is more of the same as https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/396285.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/archivepublisher/tests/archive-signing.txt b/lib/lp/archivepublisher/tests/archive-signing.txt
2index 01582b6..a4a7c7f 100644
3--- a/lib/lp/archivepublisher/tests/archive-signing.txt
4+++ b/lib/lp/archivepublisher/tests/archive-signing.txt
5@@ -451,9 +451,10 @@ have a 'signing_key' set, it raises an error.
6 >>> del get_property_cache(cprov.archive).signing_key
7
8 >>> archive_signing_key.signRepository(test_suite)
9+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
10 Traceback (most recent call last):
11 ...
12- CannotSignArchive: No signing key available for PPA for Celso Providelo
13+ lp.archivepublisher.interfaces.archivegpgsigningkey.CannotSignArchive: No signing key available for PPA for Celso Providelo
14
15 We'll purge 'signing_keys_root' and the PPA repository root so that
16 other tests don't choke on it, and shut down the server.
17diff --git a/lib/lp/archiveuploader/tests/nascentupload-announcements.txt b/lib/lp/archiveuploader/tests/nascentupload-announcements.txt
18index eda132a..b0823b7 100644
19--- a/lib/lp/archiveuploader/tests/nascentupload-announcements.txt
20+++ b/lib/lp/archiveuploader/tests/nascentupload-announcements.txt
21@@ -786,11 +786,10 @@ And then try to upload using the changes file with the malformed name.
22
23 >>> bar_src = NascentUpload.from_changesfile_path(
24 ... copyp, sync_policy, DevNullLogger())
25- >>> bar_src.process()
26+ >>> bar_src.process() # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
27 Traceback (most recent call last):
28 ...
29- EarlyReturnUploadError: An error occurred that prevented further
30- processing.
31+ lp.archiveuploader.nascentupload.EarlyReturnUploadError: An error occurred that prevented further processing.
32
33 >>> bar_src.logger = FakeLogger()
34 >>> result = bar_src.do_accept()
35diff --git a/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt b/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
36index be454a4..5acbc91 100644
37--- a/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
38+++ b/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
39@@ -151,10 +151,10 @@ Published the 'non-epoched' bar source version as the base package:
40 When publishing the 'epoched' bar source the collision is detected:
41
42 >>> bar_src_queue_epoch.realiseUpload()
43+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
44 Traceback (most recent call last):
45 ...
46- QueueInconsistentStateError: bar_1.0-1.diff.gz is already published in
47- archive for hoary
48+ lp.soyuz.interfaces.queue.QueueInconsistentStateError: bar_1.0-1.diff.gz is already published in archive for hoary
49 >>> bar_src_queue_epoch.status.name
50 'ACCEPTED'
51
52@@ -170,12 +170,10 @@ containing a orig file with diferent contents than the one already
53 published in 'non-epoched' version:
54
55 >>> bar_src_queue_epoch2.realiseUpload()
56+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
57 Traceback (most recent call last):
58 ...
59- QueueInconsistentStateError: bar_1.0.orig.tar.gz is already published in
60- archive for hoary with a different SHA1 hash
61- (e918d6f5ec2184ae1d795a130da36c9a82c4beaf !=
62- 73a04163fee97fd2257ab266bd48f1d3d528e012)
63+ lp.soyuz.interfaces.queue.QueueInconsistentStateError: bar_1.0.orig.tar.gz is already published in archive for hoary with a different SHA1 hash (e918d6f5ec2184ae1d795a130da36c9a82c4beaf != 73a04163fee97fd2257ab266bd48f1d3d528e012)
64
65 >>> bar_src_queue_epoch2.status.name
66 'ACCEPTED'
67diff --git a/lib/lp/archiveuploader/tests/nascentupload.txt b/lib/lp/archiveuploader/tests/nascentupload.txt
68index 6e2ba89..6bdda3d 100644
69--- a/lib/lp/archiveuploader/tests/nascentupload.txt
70+++ b/lib/lp/archiveuploader/tests/nascentupload.txt
71@@ -54,11 +54,10 @@ on that.
72
73 >>> nonexistent = NascentUpload.from_changesfile_path(
74 ... datadir("DOES-NOT-EXIST"), buildd_policy, FakeLogger())
75- >>> nonexistent.process()
76+ >>> nonexistent.process() # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
77 Traceback (most recent call last):
78 ...
79- EarlyReturnUploadError: An error occurred that prevented further
80- processing.
81+ lp.archiveuploader.nascentupload.EarlyReturnUploadError: An error occurred that prevented further processing.
82 >>> nonexistent.is_rejected
83 True
84 >>> print nonexistent.rejection_message
85diff --git a/lib/lp/archiveuploader/tests/nascentuploadfile.txt b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
86index a8e53af..0dbd48b 100644
87--- a/lib/lp/archiveuploader/tests/nascentuploadfile.txt
88+++ b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
89@@ -44,9 +44,10 @@ Construct the base object with just enough data to do the check:
90 The filename tries to use an epoch in an invalid way:
91
92 >>> upload_file.checkNameIsTaintFree()
93+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
94 Traceback (most recent call last):
95 ...
96- UploadError: Invalid character(s) in filename: 'package-1.1.2-3:0ubuntu4'.
97+ lp.archiveuploader.utils.UploadError: Invalid character(s) in filename: 'package-1.1.2-3:0ubuntu4'.
98
99
100 With a good filename, no exception is raised.
101@@ -258,9 +259,10 @@ Launchpad:
102 If the address is unparsable, we get an error.
103
104 >>> sig_file.parseAddress("Cannot Parse Me <FOOO>")
105+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
106 Traceback (most recent call last):
107 ...
108- UploadError: Cannot Parse Me <FOOO>: no @ found in email address part.
109+ lp.archiveuploader.utils.UploadError: Cannot Parse Me <FOOO>: no @ found in email address part.
110
111 If the email address is not yet registered and policy.create_people is True,
112 a new Person will be created.
113diff --git a/lib/lp/archiveuploader/tests/upload-path-parsing.txt b/lib/lp/archiveuploader/tests/upload-path-parsing.txt
114index 64f4ac2..17e8ba9 100644
115--- a/lib/lp/archiveuploader/tests/upload-path-parsing.txt
116+++ b/lib/lp/archiveuploader/tests/upload-path-parsing.txt
117@@ -46,9 +46,10 @@ If such distribution doesn't exist, parse_upload_path() raises
118 `UploadPathError`.
119
120 >>> check_upload('does-not-exist')
121+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
122 Traceback (most recent call last):
123 ...
124- UploadPathError: Could not find distribution 'does-not-exist'.
125+ lp.archiveuploader.uploadprocessor.UploadPathError: Could not find distribution 'does-not-exist'.
126
127 Upload to a distribution can have their 'changesfile' suite target
128 overridden by including a specific suite name in the upload path.
129@@ -67,9 +68,10 @@ Again, if the given suite name can not be found an `UploadPathError`
130 is raised.
131
132 >>> check_upload('debian/imaginary')
133+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
134 Traceback (most recent call last):
135 ...
136- UploadPathError: Could not find suite 'imaginary'.
137+ lp.archiveuploader.uploadprocessor.UploadPathError: Could not find suite 'imaginary'.
138
139
140 == PPA uploads ==
141@@ -99,15 +101,16 @@ up as a Person in Launchpad.
142 Suite: None
143
144 >>> check_upload('~does-not-exist/ubuntu/ppa')
145+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
146 Traceback (most recent call last):
147 ...
148- PPAUploadPathError: Could not find person or team named
149- 'does-not-exist'.
150+ lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find person or team named 'does-not-exist'.
151
152 >>> check_upload('~cprov/notbuntu/ppa')
153+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
154 Traceback (most recent call last):
155 ...
156- PPAUploadPathError: Could not find distribution 'notbuntu'.
157+ lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find distribution 'notbuntu'.
158
159 Two deprecated PPA paths are still supported for compatibility. Before
160 mid-2014 all PPAs were for Ubuntu, and the distribution came after the
161@@ -142,9 +145,10 @@ valid. It's also supported for uploads to the deprecated paths.
162 Suite: warty-backports
163
164 >>> check_upload('~cprov/ppa/ubuntu/boing')
165+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
166 Traceback (most recent call last):
167 ...
168- PPAUploadPathError: Could not find suite 'boing'.
169+ lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find suite 'boing'.
170
171 We will disable Celso's default PPA and uploads to it will result in
172 an error.
173@@ -157,28 +161,30 @@ an error.
174 >>> transaction.commit()
175
176 >>> check_upload('~cprov/ubuntu/ppa')
177+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
178 Traceback (most recent call last):
179 ...
180- PPAUploadPathError: PPA for Celso Providelo is disabled.
181+ lp.archiveuploader.uploadprocessor.PPAUploadPathError: PPA for Celso Providelo is disabled.
182
183 >>> check_upload('~cprov/ppa/ubuntu')
184+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
185 Traceback (most recent call last):
186 ...
187- PPAUploadPathError: PPA for Celso Providelo is disabled.
188+ lp.archiveuploader.uploadprocessor.PPAUploadPathError: PPA for Celso Providelo is disabled.
189
190 Uploading to named PPA that does not exist fails.
191
192 >>> check_upload('~cprov/ubuntu/beta')
193+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
194 Traceback (most recent call last):
195 ...
196- PPAUploadPathError: Could not find a PPA owned by 'cprov' for
197- 'ubuntu' named 'beta'.
198+ lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find a PPA owned by 'cprov' for 'ubuntu' named 'beta'.
199
200 >>> check_upload('~cprov/beta/ubuntu')
201+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
202 Traceback (most recent call last):
203 ...
204- PPAUploadPathError: Could not find a PPA owned by 'cprov' for
205- 'ubuntu' named 'beta'.
206+ lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find a PPA owned by 'cprov' for 'ubuntu' named 'beta'.
207
208 We will create a 'beta' PPA for Celso.
209
210@@ -206,45 +212,51 @@ identifies and warns users accordingly.
211 An extra path part that cannot be processed for distribution uploads.
212
213 >>> check_upload('ubuntu/warty/ding-dong')
214+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
215 Traceback (most recent call last):
216 ...
217- UploadPathError: Path format mismatch.
218+ lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
219
220 A distribution specific uploads starting with '~' as if it was a
221 person name. Note that users can't be named like distribution anyways.
222
223 >>> check_upload('~ubuntu')
224+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
225 Traceback (most recent call last):
226 ...
227- UploadPathError: Path format mismatch.
228+ lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
229
230 An extra path part that cannot be processed for PPA uploads.
231
232 >>> check_upload('~cprov/ubuntu/ppa/warty/ding-dong')
233+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
234 Traceback (most recent call last):
235 ...
236- UploadPathError: Path format mismatch.
237+ lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
238
239 A PPA upload missing '~':
240
241 >>> check_upload('cprov/ubuntu/ppa')
242+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
243 Traceback (most recent call last):
244 ...
245- UploadPathError: Path format mismatch.
246+ lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
247
248 A old-style PPA upload missing '~':
249
250 >>> check_upload('cprov/ubuntu')
251+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
252 Traceback (most recent call last):
253 ...
254- UploadPathError: Could not find distribution 'cprov'.
255+ lp.archiveuploader.uploadprocessor.UploadPathError: Could not find distribution 'cprov'.
256
257 An old-style named PPA upload missing '~'.
258
259 >>> check_upload('cprov/ppa/ubuntu')
260+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
261 Traceback (most recent call last):
262 ...
263- UploadPathError: Path format mismatch.
264+ lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
265
266
267 == Binary uploads from build slaves ==
268@@ -284,6 +296,7 @@ In the case where an archive cannot be found an 'UploadPathError' exception
269 is raised.
270
271 >>> check_upload('1234567890/ubuntu')
272+ ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
273 Traceback (most recent call last):
274 ...
275- UploadPathError: Could not find archive with id=1234567890.
276+ lp.archiveuploader.uploadprocessor.UploadPathError: Could not find archive with id=1234567890.

Subscribers

People subscribed via source and target branches

to status/vote changes: