Autotest[PY3] - setup_modules unittest

BUG=b:187788514
TEST=this in py2/3, dummy_Pass

Change-Id: I65fe470887b914817ef37ba00aa1cbcc7327e0f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3088087
Tested-by: Derek Beckett <dbeckett@chromium.org>
Reviewed-by: Ruben Zakarian <rzakarian@chromium.org>
Commit-Queue: Derek Beckett <dbeckett@chromium.org>
diff --git a/client/setup_modules_unittest.py b/client/setup_modules_unittest.py
index e3ce795..89f63fe 100755
--- a/client/setup_modules_unittest.py
+++ b/client/setup_modules_unittest.py
@@ -1,38 +1,38 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
 
-import cStringIO, logging, os, sys, unittest
+import logging, os, sys, unittest
+from six.moves import StringIO
 
 # direct imports; autotest_lib has not been setup while testing this.
-from common_lib.test_utils import mock
-import setup_modules
+from client.common_lib.test_utils import mock
+from client import setup_modules
 
 
 class LoggingErrorStderrTests(unittest.TestCase):
+    """Test the setup_modules."""
+
     def setUp(self):
         autotest_dir = os.path.abspath(os.path.join(setup_modules.dirname,
                                                     '..'))
         setup_modules.setup(autotest_dir, root_module_name='autotest_lib')
         self.god = mock.mock_god()
-        self.test_stderr = cStringIO.StringIO()
+        self.test_stderr = StringIO()
         self.god.stub_with(sys, 'stderr', self.test_stderr)
         self.old_root_logging_level = logging.root.level
         logging.basicConfig(level=logging.ERROR)
         # _autotest_logging_handle_error unsets this after being called once.
         logging.raiseExceptions = 1
 
-
     def tearDown(self):
         self.god.unstub_all()
         # Undo the setUp logging.basicConfig call.
         logging.basicConfig(level=self.old_root_logging_level)
 
-
     def assert_autotest_logging_handle_error_called(self):
         self.stderr_str = self.test_stderr.getvalue()
         self.assertTrue('Exception occurred formatting' in self.stderr_str,
                         repr(self.stderr_str))
 
-
     def test_autotest_logging_handle_error(self):
         record = logging.LogRecord(
                 'test', logging.DEBUG, __file__, 0, 'MESSAGE', 'ARGS', None)
@@ -54,21 +54,18 @@
         # Make sure this was turned off by our handle_error.
         self.assertFalse(logging.raiseExceptions)
 
-
     def test_logging_monkey_patch_wrong_number_of_args(self):
         logging.error('logging unittest %d %s', 32)
         self.assert_autotest_logging_handle_error_called()
         self.assertTrue('logging unittest' in self.stderr_str,
                         repr(self.stderr_str))
 
-
     def test_logging_monkey_patch_wrong_type_of_arg(self):
         logging.error('logging unittest %d', 'eighteen')
         self.assert_autotest_logging_handle_error_called()
         self.assertTrue('logging unittest' in self.stderr_str,
                         repr(self.stderr_str))
 
-
     def test_logging_no_error(self):
         logging.error('logging unittest.  %s %s', 'meep', 'meep!')
         self.assertEqual('', self.test_stderr.getvalue())