From 3537d7fc4ef97314bceab80beb3a9650e99641b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 4 Mar 2010 19:49:15 +0100 Subject: [PATCH] Add workaround for old version of TestCase Old version of TestCase has no __eq__ function --- trytond/tests/test_tryton.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/trytond/tests/test_tryton.py b/trytond/tests/test_tryton.py index 98708efc33..5f638ae3bd 100644 --- a/trytond/tests/test_tryton.py +++ b/trytond/tests/test_tryton.py @@ -241,8 +241,18 @@ def modules_suite(): else: continue for test in test_mod.suite(): - if test not in suite_: - suite_.addTest(test) + if hasattr(test, '__eq__'): + if test not in suite_: + suite_.addTest(test) + else: + found = False + for other in suite_: + if type(test) == type(other) and \ + test._testMethodName == other._testMethodName: + found = True + break + if not found: + suite_.addTest(test) return suite_ if __name__ == '__main__':