From 06dae8fd67f501df0049120534a4e028a207b148 Mon Sep 17 00:00:00 2001 From: Brian Warner <warner@allmydata.com> Date: Wed, 2 Apr 2008 17:48:55 -0700 Subject: [PATCH] trial_figleaf.py: make our figleaf code compatible with both Twisted-8.x and Twisted-2.5.x --- src/allmydata/test/trial_figleaf.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/trial_figleaf.py b/src/allmydata/test/trial_figleaf.py index e6abb21d..2e998c13 100644 --- a/src/allmydata/test/trial_figleaf.py +++ b/src/allmydata/test/trial_figleaf.py @@ -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 -- 2.45.2