]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
trial_figleaf.py: make our figleaf code compatible with both Twisted-8.x and Twisted...
authorBrian Warner <warner@allmydata.com>
Thu, 3 Apr 2008 00:48:55 +0000 (17:48 -0700)
committerBrian Warner <warner@allmydata.com>
Thu, 3 Apr 2008 00:48:55 +0000 (17:48 -0700)
src/allmydata/test/trial_figleaf.py

index e6abb21d20bf94c5b84d2b208e1c54c7fb27d5fe..2e998c133a68ff125ad113152d3c13e2e02f8d6f 100644 (file)
@@ -67,21 +67,35 @@ class FigleafReporter(TreeReporter):
     def __init__(self, *args, **kwargs):
         TreeReporter.__init__(self, *args, **kwargs)
 
-    def printSummary(self):
+    def stop_figleaf(self):
         figleaf.stop()
         figleaf.write_coverage(".figleaf")
         print "Figleaf results written to .figleaf"
+    def printSummary(self):
+        # for twisted-2.5.x
+        self.stop_figleaf()
         return TreeReporter.printSummary(self)
+    def done(self):
+        # for twisted-8.x
+        self.stop_figleaf()
+        return TreeReporter.done(self)
 
 class FigleafTextReporter(VerboseTextReporter):
     def __init__(self, *args, **kwargs):
         VerboseTextReporter.__init__(self, *args, **kwargs)
 
-    def printSummary(self):
+    def stop_figleaf(self):
         figleaf.stop()
         figleaf.write_coverage(".figleaf")
         print "Figleaf results written to .figleaf"
+    def printSummary(self):
+        # for twisted-2.5.x
+        self.stop_figleaf()
         return VerboseTextReporter.printSummary(self)
+    def done(self):
+        # for twisted-8.x
+        self.stop_figleaf()
+        return VerboseTextReporter.done(self)
 
 class not_FigleafReporter(object):
     # this class, used as a reporter on a fully-passing test suite, doesn't