summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2011-10-13 19:18:27 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2011-10-13 19:18:27 +0000
commitb7845768cbfaf408b22a48e41d406f7135fe9729 (patch)
tree3364c24d5005272b8e408787bd3274a7c7b8d5f4
parentd362c1546f8ad62811e5dee3cf0b43170e6e1c4c (diff)
Fix the dispatch tests on python 2.5
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/dispatch/tests/__init__.py4
-rw-r--r--tests/regressiontests/dispatch/tests/test_dispatcher.py6
-rw-r--r--tests/regressiontests/dispatch/tests/test_saferef.py14
3 files changed, 6 insertions, 18 deletions
diff --git a/tests/regressiontests/dispatch/tests/__init__.py b/tests/regressiontests/dispatch/tests/__init__.py
index 4e31710814..447975ab85 100644
--- a/tests/regressiontests/dispatch/tests/__init__.py
+++ b/tests/regressiontests/dispatch/tests/__init__.py
@@ -4,5 +4,5 @@ Unit-tests for the dispatch project
from __future__ import absolute_import
-from .test_saferef import *
-from .test_dispatcher import *
+from .test_dispatcher import DispatcherTests
+from .test_saferef import SaferefTests
diff --git a/tests/regressiontests/dispatch/tests/test_dispatcher.py b/tests/regressiontests/dispatch/tests/test_dispatcher.py
index ee63e22b99..4d336f8e03 100644
--- a/tests/regressiontests/dispatch/tests/test_dispatcher.py
+++ b/tests/regressiontests/dispatch/tests/test_dispatcher.py
@@ -116,9 +116,3 @@ class DispatcherTests(unittest.TestCase):
garbage_collect()
a_signal.disconnect(receiver_3)
self._testIsClean(a_signal)
-
-def getSuite():
- return unittest.makeSuite(DispatcherTests,'test')
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/tests/regressiontests/dispatch/tests/test_saferef.py b/tests/regressiontests/dispatch/tests/test_saferef.py
index fecded69a5..99251c5127 100644
--- a/tests/regressiontests/dispatch/tests/test_saferef.py
+++ b/tests/regressiontests/dispatch/tests/test_saferef.py
@@ -13,7 +13,7 @@ class Test2(object):
def __call__(self, obj):
pass
-class Tester(unittest.TestCase):
+class SaferefTests(unittest.TestCase):
def setUp(self):
ts = []
ss = []
@@ -47,7 +47,7 @@ class Tester(unittest.TestCase):
for s in self.ss:
self.assertTrue(s())
- def testShortCircuit (self):
+ def testShortCircuit(self):
"""Test that creation short-circuits to reuse existing references"""
sd = {}
for s in self.ss:
@@ -60,7 +60,7 @@ class Tester(unittest.TestCase):
self.assertTrue(sd.has_key(safeRef(t)))
self.assertTrue(safeRef(t) in sd)
- def testRepresentation (self):
+ def testRepresentation(self):
"""Test that the reference object's representation works
XXX Doesn't currently check the results, just that no error
@@ -70,10 +70,4 @@ class Tester(unittest.TestCase):
def _closure(self, ref):
"""Dumb utility mechanism to increment deletion counter"""
- self.closureCount +=1
-
-def getSuite():
- return unittest.makeSuite(Tester,'test')
-
-if __name__ == "__main__":
- unittest.main()
+ self.closureCount +=1 \ No newline at end of file