Fix the dispatch tests on python 2.5

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor 2011-10-13 19:18:27 +00:00
parent d362c1546f
commit b7845768cb
3 changed files with 6 additions and 18 deletions

View File

@ -4,5 +4,5 @@ Unit-tests for the dispatch project
from __future__ import absolute_import from __future__ import absolute_import
from .test_saferef import * from .test_dispatcher import DispatcherTests
from .test_dispatcher import * from .test_saferef import SaferefTests

View File

@ -116,9 +116,3 @@ class DispatcherTests(unittest.TestCase):
garbage_collect() garbage_collect()
a_signal.disconnect(receiver_3) a_signal.disconnect(receiver_3)
self._testIsClean(a_signal) self._testIsClean(a_signal)
def getSuite():
return unittest.makeSuite(DispatcherTests,'test')
if __name__ == "__main__":
unittest.main()

View File

@ -13,7 +13,7 @@ class Test2(object):
def __call__(self, obj): def __call__(self, obj):
pass pass
class Tester(unittest.TestCase): class SaferefTests(unittest.TestCase):
def setUp(self): def setUp(self):
ts = [] ts = []
ss = [] ss = []
@ -47,7 +47,7 @@ class Tester(unittest.TestCase):
for s in self.ss: for s in self.ss:
self.assertTrue(s()) self.assertTrue(s())
def testShortCircuit (self): def testShortCircuit(self):
"""Test that creation short-circuits to reuse existing references""" """Test that creation short-circuits to reuse existing references"""
sd = {} sd = {}
for s in self.ss: for s in self.ss:
@ -60,7 +60,7 @@ class Tester(unittest.TestCase):
self.assertTrue(sd.has_key(safeRef(t))) self.assertTrue(sd.has_key(safeRef(t)))
self.assertTrue(safeRef(t) in sd) self.assertTrue(safeRef(t) in sd)
def testRepresentation (self): def testRepresentation(self):
"""Test that the reference object's representation works """Test that the reference object's representation works
XXX Doesn't currently check the results, just that no error XXX Doesn't currently check the results, just that no error
@ -71,9 +71,3 @@ class Tester(unittest.TestCase):
def _closure(self, ref): def _closure(self, ref):
"""Dumb utility mechanism to increment deletion counter""" """Dumb utility mechanism to increment deletion counter"""
self.closureCount +=1 self.closureCount +=1
def getSuite():
return unittest.makeSuite(Tester,'test')
if __name__ == "__main__":
unittest.main()