← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-archivepublisher-archiveuploader-exception-modules into launchpad:master.

Commit message:
lp.archive{publisher,uploader}: Use IGNORE_EXCEPTION_MODULE_IN_PYTHON2

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/397156

This allows doctests that test tracebacks to work on both Python 2 and 3.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-archivepublisher-archiveuploader-exception-modules into launchpad:master.
diff --git a/lib/lp/archivepublisher/tests/archive-signing.txt b/lib/lp/archivepublisher/tests/archive-signing.txt
index 01582b6..a4a7c7f 100644
--- a/lib/lp/archivepublisher/tests/archive-signing.txt
+++ b/lib/lp/archivepublisher/tests/archive-signing.txt
@@ -451,9 +451,10 @@ have a 'signing_key' set,  it raises an error.
     >>> del get_property_cache(cprov.archive).signing_key
 
     >>> archive_signing_key.signRepository(test_suite)
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    CannotSignArchive: No signing key available for PPA for Celso Providelo
+    lp.archivepublisher.interfaces.archivegpgsigningkey.CannotSignArchive: No signing key available for PPA for Celso Providelo
 
 We'll purge 'signing_keys_root' and the PPA repository root so that
 other tests don't choke on it, and shut down the server.
diff --git a/lib/lp/archiveuploader/tests/nascentupload-announcements.txt b/lib/lp/archiveuploader/tests/nascentupload-announcements.txt
index eda132a..b0823b7 100644
--- a/lib/lp/archiveuploader/tests/nascentupload-announcements.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload-announcements.txt
@@ -786,11 +786,10 @@ And then try to upload using the changes file with the malformed name.
 
     >>> bar_src = NascentUpload.from_changesfile_path(
     ...     copyp, sync_policy, DevNullLogger())
-    >>> bar_src.process()
+    >>> bar_src.process()  # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    EarlyReturnUploadError: An error occurred that prevented further
-    processing.
+    lp.archiveuploader.nascentupload.EarlyReturnUploadError: An error occurred that prevented further processing.
 
     >>> bar_src.logger = FakeLogger()
     >>> result = bar_src.do_accept()
diff --git a/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt b/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
index be454a4..5acbc91 100644
--- a/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
@@ -151,10 +151,10 @@ Published the 'non-epoched' bar source version as the base package:
 When publishing the 'epoched' bar source the collision is detected:
 
     >>> bar_src_queue_epoch.realiseUpload()
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    QueueInconsistentStateError: bar_1.0-1.diff.gz is already published in
-    archive for hoary
+    lp.soyuz.interfaces.queue.QueueInconsistentStateError: bar_1.0-1.diff.gz is already published in archive for hoary
     >>> bar_src_queue_epoch.status.name
     'ACCEPTED'
 
@@ -170,12 +170,10 @@ containing a orig file with diferent contents than the one already
 published in 'non-epoched' version:
 
     >>> bar_src_queue_epoch2.realiseUpload()
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    QueueInconsistentStateError: bar_1.0.orig.tar.gz is already published in
-    archive for hoary with a different SHA1 hash
-    (e918d6f5ec2184ae1d795a130da36c9a82c4beaf !=
-    73a04163fee97fd2257ab266bd48f1d3d528e012)
+    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)
 
     >>> bar_src_queue_epoch2.status.name
     'ACCEPTED'
diff --git a/lib/lp/archiveuploader/tests/nascentupload.txt b/lib/lp/archiveuploader/tests/nascentupload.txt
index 6e2ba89..6bdda3d 100644
--- a/lib/lp/archiveuploader/tests/nascentupload.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload.txt
@@ -54,11 +54,10 @@ on that.
 
     >>> nonexistent = NascentUpload.from_changesfile_path(
     ...     datadir("DOES-NOT-EXIST"), buildd_policy, FakeLogger())
-    >>> nonexistent.process()
+    >>> nonexistent.process()  # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    EarlyReturnUploadError: An error occurred that prevented further
-    processing.
+    lp.archiveuploader.nascentupload.EarlyReturnUploadError: An error occurred that prevented further processing.
     >>> nonexistent.is_rejected
     True
     >>> print nonexistent.rejection_message
diff --git a/lib/lp/archiveuploader/tests/nascentuploadfile.txt b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
index a8e53af..0dbd48b 100644
--- a/lib/lp/archiveuploader/tests/nascentuploadfile.txt
+++ b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
@@ -44,9 +44,10 @@ Construct the base object with just enough data to do the check:
 The filename tries to use an epoch in an invalid way:
 
     >>> upload_file.checkNameIsTaintFree()
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadError: Invalid character(s) in filename: 'package-1.1.2-3:0ubuntu4'.
+    lp.archiveuploader.utils.UploadError: Invalid character(s) in filename: 'package-1.1.2-3:0ubuntu4'.
 
 
 With a good filename, no exception is raised.
@@ -258,9 +259,10 @@ Launchpad:
 If the address is unparsable, we get an error.
 
     >>> sig_file.parseAddress("Cannot Parse Me <FOOO>")
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadError: Cannot Parse Me <FOOO>: no @ found in email address part.
+    lp.archiveuploader.utils.UploadError: Cannot Parse Me <FOOO>: no @ found in email address part.
 
 If the email address is not yet registered and policy.create_people is True,
 a new Person will be created.
diff --git a/lib/lp/archiveuploader/tests/upload-path-parsing.txt b/lib/lp/archiveuploader/tests/upload-path-parsing.txt
index 64f4ac2..17e8ba9 100644
--- a/lib/lp/archiveuploader/tests/upload-path-parsing.txt
+++ b/lib/lp/archiveuploader/tests/upload-path-parsing.txt
@@ -46,9 +46,10 @@ If such distribution doesn't exist, parse_upload_path() raises
 `UploadPathError`.
 
     >>> check_upload('does-not-exist')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Could not find distribution 'does-not-exist'.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Could not find distribution 'does-not-exist'.
 
 Upload to a distribution can have their 'changesfile' suite target
 overridden by including a specific suite name in the upload path.
@@ -67,9 +68,10 @@ Again, if the given suite name can not be found an `UploadPathError`
 is raised.
 
     >>> check_upload('debian/imaginary')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Could not find suite 'imaginary'.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Could not find suite 'imaginary'.
 
 
 == PPA uploads ==
@@ -99,15 +101,16 @@ up as a Person in Launchpad.
     Suite: None
 
     >>> check_upload('~does-not-exist/ubuntu/ppa')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    PPAUploadPathError: Could not find person or team named
-    'does-not-exist'.
+    lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find person or team named 'does-not-exist'.
 
     >>> check_upload('~cprov/notbuntu/ppa')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    PPAUploadPathError: Could not find distribution 'notbuntu'.
+    lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find distribution 'notbuntu'.
 
 Two deprecated PPA paths are still supported for compatibility. Before
 mid-2014 all PPAs were for Ubuntu, and the distribution came after the
@@ -142,9 +145,10 @@ valid. It's also supported for uploads to the deprecated paths.
     Suite: warty-backports
 
     >>> check_upload('~cprov/ppa/ubuntu/boing')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    PPAUploadPathError: Could not find suite 'boing'.
+    lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find suite 'boing'.
 
 We will disable Celso's default PPA and uploads to it will result in
 an error.
@@ -157,28 +161,30 @@ an error.
     >>> transaction.commit()
 
     >>> check_upload('~cprov/ubuntu/ppa')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    PPAUploadPathError: PPA for Celso Providelo is disabled.
+    lp.archiveuploader.uploadprocessor.PPAUploadPathError: PPA for Celso Providelo is disabled.
 
     >>> check_upload('~cprov/ppa/ubuntu')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    PPAUploadPathError: PPA for Celso Providelo is disabled.
+    lp.archiveuploader.uploadprocessor.PPAUploadPathError: PPA for Celso Providelo is disabled.
 
 Uploading to named PPA that does not exist fails.
 
     >>> check_upload('~cprov/ubuntu/beta')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    PPAUploadPathError: Could not find a PPA owned by 'cprov' for
-    'ubuntu' named 'beta'.
+    lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find a PPA owned by 'cprov' for 'ubuntu' named 'beta'.
 
     >>> check_upload('~cprov/beta/ubuntu')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    PPAUploadPathError: Could not find a PPA owned by 'cprov' for
-    'ubuntu' named 'beta'.
+    lp.archiveuploader.uploadprocessor.PPAUploadPathError: Could not find a PPA owned by 'cprov' for 'ubuntu' named 'beta'.
 
 We will create a 'beta' PPA for Celso.
 
@@ -206,45 +212,51 @@ identifies and warns users accordingly.
 An extra path part that cannot be processed for distribution uploads.
 
     >>> check_upload('ubuntu/warty/ding-dong')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Path format mismatch.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
 
 A distribution specific uploads starting with '~' as if it was a
 person name. Note that users can't be named like distribution anyways.
 
     >>> check_upload('~ubuntu')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Path format mismatch.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
 
 An extra path part that cannot be processed for PPA uploads.
 
     >>> check_upload('~cprov/ubuntu/ppa/warty/ding-dong')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Path format mismatch.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
 
 A PPA upload missing '~':
 
     >>> check_upload('cprov/ubuntu/ppa')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Path format mismatch.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
 
 A old-style PPA upload missing '~':
 
     >>> check_upload('cprov/ubuntu')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Could not find distribution 'cprov'.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Could not find distribution 'cprov'.
 
 An old-style named PPA upload missing '~'.
 
     >>> check_upload('cprov/ppa/ubuntu')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Path format mismatch.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Path format mismatch.
 
 
 == Binary uploads from build slaves ==
@@ -284,6 +296,7 @@ In the case where an archive cannot be found an 'UploadPathError' exception
 is raised.
 
     >>> check_upload('1234567890/ubuntu')
+    ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
     Traceback (most recent call last):
     ...
-    UploadPathError: Could not find archive with id=1234567890.
+    lp.archiveuploader.uploadprocessor.UploadPathError: Could not find archive with id=1234567890.