Commit 496623da authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[test] Remove some usages of lgc.testlib

parent b8b71dd09a2c
......@@ -18,7 +18,8 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""unit/functional tests for cubicweb.server.hook"""
from logilab.common.testlib import TestCase, unittest_main, mock_object
import unittest
from logilab.common.testlib import mock_object
from cubicweb import devtools
from cubicweb.devtools import fake
......@@ -80,7 +81,7 @@ class AddAnyHook(hook.Hook):
raise HookCalled()
class HooksRegistryTC(TestCase):
class HooksRegistryTC(unittest.TestCase):
def setUp(self):
""" called before each test from this class """
......@@ -143,4 +144,4 @@ class SystemHooksTC(CubicWebTC):
if __name__ == '__main__':
unittest_main()
unittest.main()
......@@ -20,12 +20,12 @@
"""
from datetime import date, datetime, timedelta, tzinfo
import unittest
import pytz
from six import PY2, integer_types, binary_type, text_type
from logilab.common.testlib import TestCase, unittest_main
from rql import BadRQLQuery
from rql.utils import register_function, FunctionDescr
......@@ -101,7 +101,7 @@ class Function:
def get_type(self, solution, args=None):
return 'Int'
class MakeDescriptionTC(TestCase):
class MakeDescriptionTC(unittest.TestCase):
def test_known_values(self):
solution = {'A': 'Int', 'B': 'CWUser'}
self.assertEqual(_make_description((Function('max', 'A'), Variable('B')), {}, solution),
......@@ -1668,4 +1668,4 @@ class NonRegressionTC(CubicWebTC):
cnx.execute('Any A ORDERBY A WHERE U use_email A, U login "admin"').rows)
if __name__ == '__main__':
unittest_main()
unittest.main()
......@@ -19,9 +19,10 @@
from __future__ import print_function
import sys
import unittest
from logilab import database as db
from logilab.common.testlib import TestCase, unittest_main, mock_object
from logilab.common.testlib import mock_object
from rql import BadRQLQuery
from rql.utils import register_function, FunctionDescr
......@@ -2236,7 +2237,7 @@ WHERE NOT (DATE(_P.cw_datenaiss)=CURRENT_DATE)'''),
with self.subTest(rql=rql):
self._check(rql, sql)
class removeUnsusedSolutionsTC(TestCase):
class removeUnsusedSolutionsTC(unittest.TestCase):
def test_invariant_not_varying(self):
rqlst = mock_object(defined_vars={})
rqlst.defined_vars['A'] = mock_object(scope=rqlst, stinfo={}, _q_invariant=True)
......@@ -2259,4 +2260,4 @@ class removeUnsusedSolutionsTC(TestCase):
if __name__ == '__main__':
unittest_main()
unittest.main()
......@@ -64,5 +64,5 @@ class SSPlannerTC(BasePlannerTC):
[])])
if __name__ == '__main__':
from logilab.common.testlib import unittest_main
unittest_main()
import unittest
unittest.main()
......@@ -33,7 +33,7 @@ xy.add_equivalence('Project name', 'doap:Project dc:title')
@unittest.skipIf(SKIPCAUSE, SKIPCAUSE)
class XYTC(TestCase):
class XYTC(unittest.TestCase):
schema = None
......@@ -224,4 +224,4 @@ class XYTC(TestCase):
# }
if __name__ == '__main__':
unittest_main()
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment