← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/testfix into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/testfix into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/testfix/+merge/52632

TestTwistedJobRunner.test_timeout fails in very unobvious ways if canonical.testing.layers is imported by lp.testing. This branch fixes r12555 to not do that.
-- 
https://code.launchpad.net/~wgrant/launchpad/testfix/+merge/52632
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/testfix into lp:launchpad.
=== modified file 'lib/lp/testing/__init__.py'
--- lib/lp/testing/__init__.py	2011-03-08 15:14:54 +0000
+++ lib/lp/testing/__init__.py	2011-03-09 04:01:29 +0000
@@ -793,10 +793,13 @@
 class WebServiceTestCase(TestCaseWithFactory):
     """Test case optimized for testing the web service using launchpadlib."""
 
-    #avoid circular imports
-    from canonical.testing.layers import AppServerLayer
-
-    layer = AppServerLayer
+    @property
+    def layer(self):
+        # XXX wgrant 2011-03-09 bug=505913:
+        # TestTwistedJobRunner.test_timeout fails if this is at the
+        # module level. There is probably some hidden circular import.
+        from canonical.testing.layers import AppServerLayer
+        return AppServerLayer
 
     def setUp(self):
         super(WebServiceTestCase, self).setUp()