equal
deleted
inserted
replaced
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """unittests for cw.devtools.testlib module""" |
18 """unittests for cw.devtools.testlib module""" |
19 |
19 |
20 from io import BytesIO, StringIO |
20 from io import BytesIO, StringIO |
21 from unittest import TextTestRunner |
21 from unittest import TextTestRunner |
22 |
|
23 from six import PY2 |
|
24 |
22 |
25 from logilab.common.testlib import TestSuite, TestCase, unittest_main |
23 from logilab.common.testlib import TestSuite, TestCase, unittest_main |
26 from logilab.common.registry import yes |
24 from logilab.common.registry import yes |
27 |
25 |
28 from cubicweb.devtools import htmlparser |
26 from cubicweb.devtools import htmlparser |
50 'file': ('filename.txt', sio)}) |
48 'file': ('filename.txt', sio)}) |
51 |
49 |
52 class WebTestTC(TestCase): |
50 class WebTestTC(TestCase): |
53 |
51 |
54 def setUp(self): |
52 def setUp(self): |
55 output = BytesIO() if PY2 else StringIO() |
53 output = StringIO() |
56 self.runner = TextTestRunner(stream=output) |
54 self.runner = TextTestRunner(stream=output) |
57 |
55 |
58 def test_error_raised(self): |
56 def test_error_raised(self): |
59 class MyWebTest(CubicWebTC): |
57 class MyWebTest(CubicWebTC): |
60 |
58 |