← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:test-process-accepted-isolation into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:test-process-accepted-isolation into launchpad:master.

Commit message:
Fix test isolation in TestProcessAccepted.test_commits_after_each_item

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

We need to unregister the custom synchronizer during test cleanup, as otherwise it may be called later without an interaction and crash the test runner.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:test-process-accepted-isolation into launchpad:master.
diff --git a/lib/lp/archivepublisher/tests/test_processaccepted.py b/lib/lp/archivepublisher/tests/test_processaccepted.py
index 90210ce..6b7147f 100644
--- a/lib/lp/archivepublisher/tests/test_processaccepted.py
+++ b/lib/lp/archivepublisher/tests/test_processaccepted.py
@@ -166,6 +166,7 @@ class TestProcessAccepted(TestCaseWithFactory):
         switch_dbuser(self.dbuser)
         synch = UploadCheckingSynchronizer()
         transaction.manager.registerSynch(synch)
+        self.addCleanup(transaction.manager.unregisterSynch, synch)
         script.main()
         self.assertThat(len(uploads), LessThan(synch.commit_count))