cubicweb/test/unittest_cwctl.py
changeset 12567 26744ad37953
parent 12121 86ec847835cd
child 12568 fc45f22c8100
equal deleted inserted replaced
12566:6b3523f81f42 12567:26744ad37953
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 import sys
    18 import sys
    19 import os
    19 import os
    20 from os.path import join
    20 from os.path import join
    21 from io import StringIO, BytesIO
    21 from io import StringIO
    22 import unittest
    22 import unittest
    23 
       
    24 from six import PY2
       
    25 
    23 
    26 from mock import patch
    24 from mock import patch
    27 
    25 
    28 from cubicweb.cwctl import ListCommand
    26 from cubicweb.cwctl import ListCommand
    29 from cubicweb.devtools.testlib import CubicWebTC
    27 from cubicweb.devtools.testlib import CubicWebTC
    36 
    34 
    37     setUpClass = unittest_cwconfig.CubicWebConfigurationTC.setUpClass
    35     setUpClass = unittest_cwconfig.CubicWebConfigurationTC.setUpClass
    38     tearDownClass = unittest_cwconfig.CubicWebConfigurationTC.tearDownClass
    36     tearDownClass = unittest_cwconfig.CubicWebConfigurationTC.tearDownClass
    39 
    37 
    40     def setUp(self):
    38     def setUp(self):
    41         self.stream = BytesIO() if PY2 else StringIO()
    39         self.stream = StringIO()
    42         sys.stdout = self.stream
    40         sys.stdout = self.stream
    43 
    41 
    44     def tearDown(self):
    42     def tearDown(self):
    45         sys.stdout = sys.__stdout__
    43         sys.stdout = sys.__stdout__
    46 
    44