mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Create a new testing_support module to move utility modules there
It will simplify importing utility modules from other projects. Otherwise I was getting name conflicts with 'test'. Reenable W0403 that was disabled in the previous CL. R=dpranke@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/8508015 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@109636 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,7 +6,7 @@
|
|||||||
/svn.bat
|
/svn.bat
|
||||||
/svn_bin
|
/svn_bin
|
||||||
/svnversion.bat
|
/svnversion.bat
|
||||||
/tests/_rietveld
|
/depot_tools_testing_lib/_rietveld
|
||||||
/tests/subversion_config/README.txt
|
/tests/subversion_config/README.txt
|
||||||
/tests/subversion_config/auth
|
/tests/subversion_config/auth
|
||||||
/tests/subversion_config/servers
|
/tests/subversion_config/servers
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ def CommonChecks(input_api, output_api, tests_to_black_list):
|
|||||||
r'^cpplint_chromium\.py$',
|
r'^cpplint_chromium\.py$',
|
||||||
r'^python_bin[\/\\].+',
|
r'^python_bin[\/\\].+',
|
||||||
r'^svn_bin[\/\\].+',
|
r'^svn_bin[\/\\].+',
|
||||||
r'^tests[\/\\]\w+?[\/\\].+']
|
r'^testing_support[\/\\]_rietveld[\/\\].+']
|
||||||
results.extend(input_api.canned_checks.RunPylint(
|
results.extend(input_api.canned_checks.RunPylint(
|
||||||
input_api,
|
input_api,
|
||||||
output_api,
|
output_api,
|
||||||
@@ -59,7 +59,7 @@ def RunGitClTests(input_api, output_api):
|
|||||||
old_sys_path = sys.path
|
old_sys_path = sys.path
|
||||||
try:
|
try:
|
||||||
sys.path = [input_api.PresubmitLocalPath()] + sys.path
|
sys.path = [input_api.PresubmitLocalPath()] + sys.path
|
||||||
from tests import local_rietveld # pylint: disable=W0403
|
from testing_support import local_rietveld
|
||||||
server = local_rietveld.LocalRietveld()
|
server = local_rietveld.LocalRietveld()
|
||||||
finally:
|
finally:
|
||||||
sys.path = old_sys_path
|
sys.path = old_sys_path
|
||||||
|
|||||||
3
pylintrc
3
pylintrc
@@ -57,14 +57,13 @@ load-plugins=
|
|||||||
# W0141: Used builtin function ''
|
# W0141: Used builtin function ''
|
||||||
# W0142: Used * or ** magic
|
# W0142: Used * or ** magic
|
||||||
# W0402: Uses of a deprecated module 'string'
|
# W0402: Uses of a deprecated module 'string'
|
||||||
# W0403: Relative import 'X', should be 'Y.X'
|
|
||||||
# W0404: 41: Reimport 'XX' (imported line NN)
|
# W0404: 41: Reimport 'XX' (imported line NN)
|
||||||
# W0511: TODO
|
# W0511: TODO
|
||||||
# W0603: Using the global statement
|
# W0603: Using the global statement
|
||||||
# W0613: Unused argument ''
|
# W0613: Unused argument ''
|
||||||
# W0703: Catch "Exception"
|
# W0703: Catch "Exception"
|
||||||
# W1201: Specify string format arguments as logging function parameters
|
# W1201: Specify string format arguments as logging function parameters
|
||||||
disable=C0103,C0111,C0302,I0010,I0011,R0401,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,W0122,W0141,W0142,W0402,W0403,W0404,W0511,W0603,W0613,W0703,W1201
|
disable=C0103,C0111,C0302,I0010,I0011,R0401,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,W0122,W0141,W0142,W0402,W0404,W0511,W0603,W0613,W0703,W1201
|
||||||
|
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
|
|||||||
0
testing_support/__init__.py
Normal file
0
testing_support/__init__.py
Normal file
@@ -18,7 +18,7 @@ import tempfile
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
# trial_dir must be first for non-system libraries.
|
# trial_dir must be first for non-system libraries.
|
||||||
from tests import trial_dir
|
from testing_support import trial_dir
|
||||||
import gclient_utils
|
import gclient_utils
|
||||||
import scm
|
import scm
|
||||||
import subprocess2
|
import subprocess2
|
||||||
@@ -16,7 +16,6 @@ import socket
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
|
||||||
import subprocess2
|
import subprocess2
|
||||||
|
|
||||||
|
|
||||||
@@ -90,8 +90,9 @@ class StdoutCheck(object):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
# Override the mock with a StringIO, it's much less painful to test.
|
# Override the mock with a StringIO, it's much less painful to test.
|
||||||
self._old_stdout = sys.stdout
|
self._old_stdout = sys.stdout
|
||||||
sys.stdout = StringIO.StringIO()
|
stdout = StringIO.StringIO()
|
||||||
sys.stdout.flush = lambda: None
|
stdout.flush = lambda: None
|
||||||
|
sys.stdout = stdout
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
@@ -10,7 +10,7 @@ import sys
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from super_mox import SuperMoxTestBase
|
from testing_support.super_mox import SuperMoxTestBase
|
||||||
|
|
||||||
import breakpad
|
import breakpad
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,12 @@ from xml.etree import ElementTree
|
|||||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
sys.path.insert(0, os.path.dirname(ROOT_DIR))
|
sys.path.insert(0, os.path.dirname(ROOT_DIR))
|
||||||
|
|
||||||
|
from testing_support import fake_repos
|
||||||
|
from testing_support.patches_data import GIT, RAW
|
||||||
|
|
||||||
import checkout
|
import checkout
|
||||||
import patch
|
import patch
|
||||||
import subprocess2
|
import subprocess2
|
||||||
from tests import fake_repos
|
|
||||||
from tests.patches_data import GIT, RAW
|
|
||||||
|
|
||||||
|
|
||||||
# pass -v to enable it.
|
# pass -v to enable it.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import sys
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from super_mox import mox, SuperMoxTestBase
|
from testing_support.super_mox import mox, SuperMoxTestBase
|
||||||
|
|
||||||
import gcl
|
import gcl
|
||||||
import presubmit_support
|
import presubmit_support
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import __builtin__
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from super_mox import mox, StdoutCheck, SuperMoxTestBase
|
from testing_support.super_mox import mox, StdoutCheck, SuperMoxTestBase
|
||||||
from super_mox import TestCaseUtils
|
from testing_support.super_mox import TestCaseUtils
|
||||||
|
|
||||||
import gclient_scm
|
import gclient_scm
|
||||||
import subprocess2
|
import subprocess2
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import unittest
|
|||||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
sys.path.insert(0, ROOT_DIR)
|
sys.path.insert(0, ROOT_DIR)
|
||||||
|
|
||||||
from fake_repos import join, write, FakeReposTestBase
|
from testing_support.fake_repos import join, write, FakeReposTestBase
|
||||||
|
|
||||||
import subprocess2
|
import subprocess2
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|||||||
|
|
||||||
import gclient
|
import gclient
|
||||||
import gclient_utils
|
import gclient_utils
|
||||||
from tests import trial_dir
|
from testing_support import trial_dir
|
||||||
|
|
||||||
|
|
||||||
def write(filename, content):
|
def write(filename, content):
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import sys
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from super_mox import SuperMoxTestBase
|
from testing_support.super_mox import SuperMoxTestBase
|
||||||
import trial_dir
|
from testing_support import trial_dir
|
||||||
|
|
||||||
import gclient_utils
|
import gclient_utils
|
||||||
import subprocess2
|
import subprocess2
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ import unittest
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
from testing_support import filesystem_mock
|
||||||
|
|
||||||
import owners
|
import owners
|
||||||
from tests import filesystem_mock
|
|
||||||
|
|
||||||
ben = 'ben@example.com'
|
ben = 'ben@example.com'
|
||||||
brett = 'brett@example.com'
|
brett = 'brett@example.com'
|
||||||
|
|||||||
@@ -13,8 +13,9 @@ import unittest
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
from testing_support.patches_data import GIT, RAW
|
||||||
|
|
||||||
import patch
|
import patch
|
||||||
from tests.patches_data import GIT, RAW
|
|
||||||
|
|
||||||
|
|
||||||
class PatchTest(unittest.TestCase):
|
class PatchTest(unittest.TestCase):
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import time
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from super_mox import mox, SuperMoxTestBase
|
from testing_support.super_mox import mox, SuperMoxTestBase
|
||||||
|
|
||||||
import owners
|
import owners
|
||||||
import presubmit_support as presubmit
|
import presubmit_support as presubmit
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ import unittest
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
from testing_support.patches_data import GIT, RAW
|
||||||
|
|
||||||
import patch
|
import patch
|
||||||
import rietveld
|
import rietveld
|
||||||
from tests.patches_data import GIT, RAW
|
|
||||||
|
|
||||||
|
|
||||||
def _api(files):
|
def _api(files):
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import unittest
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from super_mox import SuperMoxTestBase
|
from testing_support import fake_repos
|
||||||
|
from testing_support.super_mox import SuperMoxTestBase
|
||||||
|
|
||||||
import fake_repos
|
|
||||||
import scm
|
import scm
|
||||||
import subprocess2
|
import subprocess2
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import sys
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from super_mox import SuperMoxTestBase
|
from testing_support.super_mox import SuperMoxTestBase
|
||||||
|
|
||||||
import subprocess2
|
import subprocess2
|
||||||
import trychange
|
import trychange
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ import sys
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
import super_mox
|
from testing_support import super_mox
|
||||||
|
|
||||||
import watchlists
|
import watchlists
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user