Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: tests/gclient_scm_test.py

Issue 8508017: Standardize the sys.path fix up and fix a few pylint warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Previous patchset was broken Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/gcl_unittest.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_scm_test.py
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index 908b322b2d896e9f6a6cae066391e1b75c6dd650..4c57c3d01437a1ca1f564d3fa49c8945a3e65820 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -5,21 +5,25 @@
"""Unit tests for gclient_scm.py."""
-# pylint: disable=E1101,E1103,W0403
+# pylint: disable=E1103
# Import before super_mox to keep valid references.
from os import rename
from shutil import rmtree
from subprocess import Popen, PIPE, STDOUT
+
+import logging
+import os
+import sys
import tempfile
import unittest
import __builtin__
-# Fixes include path.
-from super_mox import mox, StdoutCheck, TestCaseUtils, SuperMoxTestBase
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+from super_mox import mox, StdoutCheck, SuperMoxTestBase
+from super_mox import TestCaseUtils
-import logging
-import sys
import gclient_scm
import subprocess2
@@ -30,6 +34,7 @@ join = gclient_scm.os.path.join
class GCBaseTestCase(object):
def assertRaisesError(self, msg, fn, *args, **kwargs):
"""Like unittest's assertRaises() but checks for Gclient.Error."""
+ # pylint: disable=E1101
try:
fn(*args, **kwargs)
except gclient_scm.gclient_utils.Error, e:
@@ -252,9 +257,8 @@ class SVNWrapperTestCase(BaseTestCase):
gclient_scm.os.path.islink(file_path).AndReturn(False)
gclient_scm.os.path.isdir(file_path).AndReturn(True)
gclient_scm.gclient_utils.RemoveDirectory(file_path)
- gclient_scm.os.path.isdir(self.base_path).AndReturn(False)
- # The mock is unbound so self is not necessary.
# pylint: disable=E1120
+ gclient_scm.os.path.isdir(self.base_path).AndReturn(False)
gclient_scm.SVNWrapper.update(options, [], ['.'])
self.mox.ReplayAll()
« no previous file with comments | « tests/gcl_unittest.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698