Standardize the sys.path fix up and fix a few pylint warnings.

Disable temporarily W0403, will be reenabled on the next CL

[email protected]
BUG=
TEST=

Review URL: http://codereview.chromium.org/8508017

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@109435 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tests/subprocess2_test.py b/tests/subprocess2_test.py
index 9d30452..54e4e15 100755
--- a/tests/subprocess2_test.py
+++ b/tests/subprocess2_test.py
@@ -11,14 +11,10 @@
 import time
 import unittest
 
-ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-sys.path.insert(0, ROOT_DIR)
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 import subprocess2
 
-# Method could be a function
-# pylint: disable=R0201
-
 class Subprocess2Test(unittest.TestCase):
   # Can be mocked in a test.
   TO_SAVE = {
@@ -62,7 +58,8 @@
         assert not results
         results.update(kwargs)
         results['args'] = args
-      def communicate(self):
+      @staticmethod
+      def communicate():
         return None, None
     subprocess2.Popen = fake_Popen
     return results
@@ -76,7 +73,8 @@
         assert not results
         results.update(kwargs)
         results['args'] = args
-      def communicate(self):
+      @staticmethod
+      def communicate():
         return None, None
     subprocess2.subprocess.Popen = fake_Popen
     return results