[Test] Tests don't inherite anymore from CWTestCase by directly from unittest2 (be independant)
authorSimon Chabot <simon.chabot@logilab.fr>
Thu, 18 Oct 2012 18:18:40 +0200
changeset 25 1af8af49bf1f
parent 24 85a396a8f66d
child 26 22e2d6735e89
[Test] Tests don't inherite anymore from CWTestCase by directly from unittest2 (be independant)
test/test_alignment.py
--- a/test/test_alignment.py	Thu Oct 18 18:15:25 2012 +0200
+++ b/test/test_alignment.py	Thu Oct 18 18:18:40 2012 +0200
@@ -39,13 +39,14 @@
             return ('some', 'startup', 'views')
 """
 
-from cubicweb.devtools import testlib
+import unittest2
+
 from cubes.alignment.distances import (levenshtein, soundex, soundexcode, \
                                        jaccard, temporal, euclidean)
 from cubes.alignment.normalize import (lunormalize, loadlemmas, lemmatized, \
                                        roundstr, rgxformat, tokenize)
 
-class DistancesTest(testlib.CubicWebTC):
+class DistancesTest(unittest2.TestCase):
     def test_levenshtein(self):
         self.assertEqual(levenshtein('niche', 'chiens'), 5)
         self.assertEqual(levenshtein('bonjour', 'bonjour !'), 2)
@@ -114,7 +115,7 @@
         self.assertEqual(euclidean(-10, 11), 21)
         self.assertEqual(euclidean('-10', '11'), 21)
 
-class NormalizerTestCase(testlib.CubicWebTC):
+class NormalizerTestCase(unittest2.TestCase):
     def setUp(self):
         self.lemmas = loadlemmas('../data/french_lemmas.txt')
 
@@ -153,5 +154,4 @@
 
 
 if __name__ == '__main__':
-    from logilab.common.testlib import unittest_main
-    unittest_main()
+    unittest2.main()