diff options
Diffstat (limited to 'src/engine/SCons/MemoizeTests.py')
-rw-r--r-- | src/engine/SCons/MemoizeTests.py | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/engine/SCons/MemoizeTests.py b/src/engine/SCons/MemoizeTests.py index f51ed80..6b71e24 100644 --- a/src/engine/SCons/MemoizeTests.py +++ b/src/engine/SCons/MemoizeTests.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/MemoizeTests.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/MemoizeTests.py 5023 2010/06/14 22:05:46 scons" import sys import unittest @@ -30,7 +30,7 @@ import SCons.Memoize -class FakeObject: +class FakeObject(object): __metaclass__ = SCons.Memoize.Memoized_Metaclass @@ -85,7 +85,7 @@ class FakeObject: return mc return None -class Returner: +class Returner(object): def __init__(self, result): self.result = result self.calls = 0 @@ -132,12 +132,8 @@ class CountDictTestCase(unittest.TestCase): c = obj.get_memoizer_counter('dict') - if SCons.Memoize.use_metaclass: - assert c.hit == 3, c.hit - assert c.miss == 2, c.miss - else: - assert c.hit == 0, c.hit - assert c.miss == 0, c.miss + assert c.hit == 3, c.hit + assert c.miss == 2, c.miss class CountValueTestCase(unittest.TestCase): @@ -171,12 +167,8 @@ class CountValueTestCase(unittest.TestCase): c = obj.get_memoizer_counter('value') - if SCons.Memoize.use_metaclass: - assert c.hit == 3, c.hit - assert c.miss == 1, c.miss - else: - assert c.hit == 0, c.hit - assert c.miss == 0, c.miss + assert c.hit == 3, c.hit + assert c.miss == 1, c.miss if __name__ == "__main__": @@ -187,7 +179,7 @@ if __name__ == "__main__": ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') - suite.addTests(map(tclass, names)) + suite.addTests(list(map(tclass, names))) if not unittest.TextTestRunner().run(suite).wasSuccessful(): sys.exit(1) |